Re: very slow largeobject transfers through JDBC

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: very slow largeobject transfers through JDBC
Дата
Msg-id CADK3HHJgjg2pcG-dh_yv5Hjx36KHhi3tkBYM6VLg+F6vzuCmFQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: very slow largeobject transfers through JDBC  (Mate Varga <m@matevarga.net>)
Ответы Re: very slow largeobject transfers through JDBC
Список pgsql-general


On Mon, 3 Sep 2018 at 03:55, Mate Varga <m@matevarga.net> wrote:
Basically there's a class with a byte[] field, the class is mapped to table T and the byte field is annotated with @Lob so it goes to the pg_largeobject table.

Ah, so hibernate is in the mix. I wonder if that is causing some challenges ?
 
The DB is on separate host but relatively close to the app, and I can reproduce the problem locally as well. One interesting bit is that turning of SSL between the app and PSQL speeds up things by at least 50%.

Ah, one addition -- the binary objects are encrypted, so their entropy is very high.

Any chance you could write a simple non-hibernate test code to time the code ? 

 
Mate

On Sun, Sep 2, 2018 at 12:55 AM Dave Cramer <pg@fastcrypt.com> wrote:



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 по дате отправления:

Предыдущее
От: Mate Varga
Дата:
Сообщение: Re: very slow largeobject transfers through JDBC
Следующее
От: Mate Varga
Дата:
Сообщение: Re: very slow largeobject transfers through JDBC