Re: vacuum analyze slows sql query

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: vacuum analyze slows sql query
Дата
Msg-id 41931CCC.6070803@bigfoot.com
обсуждение исходный текст
Ответ на Re: vacuum analyze slows sql query  (patrick ~ <sidsrr@yahoo.com>)
Список pgsql-performance
patrick ~ wrote:
> --- John Meinel <john@johnmeinel.com> wrote:
>
>
>>If you are trying to establish existence, we also had a whole thread on
>>this. Basically what we found was that adding an ORDER BY clause, helped
>>tremendously in getting the planner to switch to an Index scan. You
>>might try something like:
>>
>>SELECT column FROM mytable WHERE column='myval' ORDER BY column LIMIT 1;
>>
>>There seems to be a big difference between the above statement and:
>>
>>SELECT column FROM mytable WHERE column='myval' LIMIT 1;
>
>
>
> The ORDER BY "trick" worked beautifully!  I just hope it'll
> continue to work consistently in production code.

For sure it will not break the goal: "check the existence".



Regards
Gaetano Mendola






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

Предыдущее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: How to speed-up inserts with jdbc
Следующее
От: Allen Landsidel
Дата:
Сообщение: Re: Strange (?) Index behavior?