Re: [PERFORM] Slow query in JDBC

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: [PERFORM] Slow query in JDBC
Дата
Msg-id CAOBaU_bDpYP-G0uA4Rbdv6DgToEGgkMvufftxxzAJWWcxoCKfg@mail.gmail.com
обсуждение исходный текст
Ответ на [PERFORM] Slow query in JDBC  (Subramaniam C <subramaniam31784@gmail.com>)
Ответы Re: [PERFORM] Slow query in JDBC  (Subramaniam C <subramaniam31784@gmail.com>)
Список pgsql-performance
On Thu, Sep 28, 2017 at 10:19 AM, Subramaniam C
<subramaniam31784@gmail.com> wrote:
> Hi
>
> When I try to execute the query from sql command line then that query is
> taking only around 1 sec. But when I execute the query using JDBC(Java)
> using preparedStatement then the same query is taking around 10 secs.
>
> Can you please let us know the reason and how to fix this issue?


I think jdbc always uses cursor, which can be problematic with default
configuration, because postgres will try to generate plans that
returns fast the first rows but not all the rows .  Can you try to
configure cursor_tuple_fraction to 1 and see if that fixes your issue?


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

В списке pgsql-performance по дате отправления:

Предыдущее
От: Subramaniam C
Дата:
Сообщение: [PERFORM] Slow query in JDBC
Следующее
От: Subramaniam C
Дата:
Сообщение: Re: [PERFORM] Slow query in JDBC