Re: index use again and again
От | Holger Marzen |
---|---|
Тема | Re: index use again and again |
Дата | |
Msg-id | Pine.LNX.4.44.0202121602470.16992-100000@bluebell.marzen.de обсуждение исходный текст |
Ответ на | Re: index use again and again ("Roderick A. Anderson" <raanders@tincan.org>) |
Список | pgsql-general |
On Tue, 12 Feb 2002, Roderick A. Anderson wrote: > On Tue, 12 Feb 2002, Holger Marzen wrote: > > > I read the Postgres boog, browsed the mailing list archives and have > > still no clue. > > > > I have a table with about 150.000 rows and put some indexes (not unique) > > on it. If I use "=" in the where clause tha index is used, if I use ">" > > or "between" then it is not used. It happens both with 7.1.3 and the new > > 7.2: > > Previous discussion on this topic give me the idea that index use is > determined by the optimizer and it will use and index or sequential > depending on some percentage of the records it thinks will be returned. > I.e. is it more economical to just go through them all or spend time > jumping around getting the right records. Of course one of the hackers > will be able to give you a much better and probably correct explanation. Yes. When I choose a ">" that returns only a few rows then EXPLAIN reports an index scan. So it's depending on the number of returned rows. -- PGP/GPG Key-ID: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xB5A1AFE1
В списке pgsql-general по дате отправления: