Re: index being ignored for "limit n" queries

Поиск
Список
Период
Сортировка
От Piotr Sulecki
Тема Re: index being ignored for "limit n" queries
Дата
Msg-id 42F9A25B.5070907@sybilla.traxelektronik.pl
обсуждение исходный текст
Ответ на Re: index being ignored for "limit n" queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Ave!

Tom Lane wrote:
>>trax=# explain select * from pakiety where stid = 234::smallint order by
>>received desc limit 1;
>
> The reason this won't use the (stid, received) index is that the
> requested sort order doesn't match that index.  Try
>
> select * from pakiety where stid = 234::smallint
> order by stid desc, received desc
> limit 1;

Thanks. It works. And the speedup was from 2 minutes 32.13 seconds to
0.69 seconds (in a worst case for the previous scenario).

Thanks again for your help.

Piotr Sulecki.

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

Предыдущее
От: "Pit M."
Дата:
Сообщение: libpy and ENABLE_THREAD_SAFETY=1
Следующее
От: "Pit M."
Дата:
Сообщение: Howto build libpq.dll using VC2003 and ENABLE_THREAD_SAFETY=1