Re: Need advice to avoid ORDER BY

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Need advice to avoid ORDER BY
Дата
Msg-id 515DF9AD.5000005@hogranch.com
обсуждение исходный текст
Ответ на Re: Need advice to avoid ORDER BY  (Condor <condor@stz-bg.com>)
Список pgsql-general
On 4/4/2013 2:49 PM, Condor wrote:
> Your solution is work, but Im now a little confused. I has a index
> CREATE INDEX ON mytable (valids) USING BTREE (valids) and the
> query to find valids = 0 tooks 137 ms.

the query can't use that index, and the separate index on id at the same
time, it has to pick one.

Merlin's partial index is how you get around this.

--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Need advice to avoid ORDER BY
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Need advice to avoid ORDER BY