Re: SELECT min(id) FROM test; uses seqscan
От | Philip Warner |
---|---|
Тема | Re: SELECT min(id) FROM test; uses seqscan |
Дата | |
Msg-id | 3.0.5.32.20010503125005.02dad200@mail.rhyme.com.au обсуждение исходный текст |
Ответ на | SELECT min(id) FROM test; uses seqscan (pgsql-bugs@postgresql.org) |
Ответы |
Re: SELECT min(id) FROM test; uses seqscan
|
Список | pgsql-bugs |
At 09:08 2/05/01 -0400, pgsql-bugs@postgresql.org wrote: >SELECT min(id) FROM test; uses sequential scan even if an index on "id" exists. VACUUM ANALYZE doesn't help. > This is a known stupidity of PG, and will probably be fixed in a relatively distant future release (when index entries are updated to match row status). The simple workaround is: Select id from test order by id as limit 1; ---------------------------------------------------------------- Philip Warner | __---_____ Albatross Consulting Pty. Ltd. |----/ - \ (A.B.N. 75 008 659 498) | /(@) ______---_ Tel: (+61) 0500 83 82 81 | _________ \ Fax: (+61) 0500 83 82 82 | ___________ | Http://www.rhyme.com.au | / \| | --________-- PGP key available upon request, | / and from pgp5.ai.mit.edu:11371 |/
В списке pgsql-bugs по дате отправления: