Re: problem with max and not using index on PK

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: problem with max and not using index on PK
Дата
Msg-id 5.1.0.14.0.20030503220308.02bcfe68@mail.rhyme.com.au
обсуждение исходный текст
Ответ на problem with max and not using index on PK  (pginfo <pginfo@t1.unisoftbg.com>)
Список pgsql-sql
At 11:12 AM 3/05/2003 +0200, pginfo wrote:
>I do not know the reason for not using index in this case.

PostgreSQL does not know that it can use the index, and the query example 
you gave is about the only case in which it can use the index. You can get 
it to use an index by rewriting it as:
    select IDS from t_sk10 order by IDS desc limit 1;

...nowhere near as nice, but it works.



----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 03 5330 3172          |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



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

Предыдущее
От: pginfo
Дата:
Сообщение: problem with max and not using index on PK
Следующее
От: pginfo
Дата:
Сообщение: Re: problem with max and not using index on PK