Re: Slow query after upgrades

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow query after upgrades
Дата
Msg-id 22413.1197588665@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Slow query after upgrades  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: Slow query after upgrades  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Oliver Jowett <oliver@opencloud.com> writes:
> Tom Duffey wrote:
>> This makes a huge difference, thanks.  However, is there anything I can
>> do to help improve the performance of that query when using a newer
>> protocol?

> We need to work out what is going wrong under the newer protocol first,

It looks pretty obvious from the peanut gallery: in the parameterized
query, the planner daren't choose an indexscan, because for the vast
majority of the possible values of the parameter an indexscan would
suck.

Tom's apparently only interested in the case where the parameter is
close to the end of the range, so that only a few rows need to be
retrieved.  In this case the indexscan wins big, but the planner can't
count on that.

A possible hack is to put a reasonably small LIMIT on the query.

            regards, tom lane

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

Предыдущее
От: Tom Duffey
Дата:
Сообщение: Re: Slow query after upgrades
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Slow query after upgrades