Re: [EXTERNAL] Re: Performance down with JDBC 42

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [EXTERNAL] Re: Performance down with JDBC 42
Дата
Msg-id CAApHDvq2tB4a7TAw8pXkukoqfvWr1+LccEwYoJoXe8DpsyBh1A@mail.gmail.com
обсуждение исходный текст
Ответ на RE: [EXTERNAL] Re: Performance down with JDBC 42  ("Abraham, Danny" <danny_abraham@bmc.com>)
Ответы Re: [EXTERNAL] Performance down with JDBC 42  (Frits Hoogland <frits.hoogland@gmail.com>)
Список pgsql-performance
On Mon, 6 Nov 2023 at 08:37, Abraham, Danny <danny_abraham@bmc.com> wrote:
>
> Both plans refer to the same DB.

JDBC is making use of PREPARE statements, whereas psql, unless you're
using PREPARE is not.

> #1 – Fast – using psql or old JDBC driver

The absence of any $1 type parameters here shows that's a custom plan
that's planned specifically using the parameter values given.

> Slow – when using JDBC 42

Because this query has $1, $2, etc, that's a generic plan. When
looking up statistics histogram bounds and MCV slots cannot be
checked. Only ndistinct is used. If you have a skewed dataset, then
this might not be very good.

You might find things run better if you adjust postgresql.conf and set
plan_cache_mode = force_custom_plan then select pg_reload_conf();

Please also check the documentation so that you understand the full
implications for that.

David



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

Предыдущее
От: "Abraham, Danny"
Дата:
Сообщение: RE: [EXTERNAL] Re: Performance down with JDBC 42
Следующее
От: Frits Hoogland
Дата:
Сообщение: Re: [EXTERNAL] Performance down with JDBC 42