Re: very slow largeobject transfers through JDBC - Mailing list pgsql-general

From Dave Cramer
Subject Re: very slow largeobject transfers through JDBC
Date
Msg-id CADK3HHJ_=qTU4=5RiMGgf0QGxPFD4Z+MKYqzD3p8G99vTS4pbg@mail.gmail.com
Whole thread Raw
In response to Re: very slow largeobject transfers through JDBC  (Mate Varga <m@matevarga.net>)
Responses Re: very slow largeobject transfers through JDBC  (Mate Varga <m@matevarga.net>)
List pgsql-general



On Fri, 31 Aug 2018 at 10:15, Mate Varga <m@matevarga.net> wrote:
I see -- we could try that, though we're mostly using an ORM (Hibernate) to do this. Thanks!

On Fri, Aug 31, 2018 at 3:57 PM Dmitry Igrishin <dmitigr@gmail.com> wrote:
пт, 31 авг. 2018 г. в 16:35, Mate Varga <m@matevarga.net>:
>
> Hi,
>
> we're fetching binary data from pg_largeobject table. The data is not very large, but we ended up storing it there. If I'm copying the data to a file from the psql console, then it takes X time (e.g. a second), fetching it through the JDBC driver takes at least 10x more. We don't see this difference between JDBC and 'native' performance for anything except largeobjects (and bytea columns, for the record).
>
> Does anyone have any advice about whether this can be tuned or what the cause is?
I don't know what a reason of that, but I think it's reasonable and
quite simple to call lo_import()/lo_export() via JNI.

Can't imagine that's any faster. The driver simply implements the protocol

Do you have any code to share ? Any other information ?

Is the JDBC connection significantly further away network wise ?

pgsql-general by date:

Previous
From: Guyren Howe
Date:
Subject: Re: Rules and decision logic triggered by / acting on JSONB nodes inPostgres
Next
From: Dave Peticolas
Date:
Subject: Re: locate DB corruption