Re: index is not used
От | mila boldareva |
---|---|
Тема | Re: index is not used |
Дата | |
Msg-id | 43164924839.20020821100736@dds.nl обсуждение исходный текст |
Ответ на | Re: index is not used (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: index is not used
|
Список | pgsql-novice |
> mila boldareva <pierro@dds.nl> writes: >> But the indices are not used, even when I added a separate index on >> field1 ! > Have you run ANALYZE (or VACUUM ANALYZE) on that table? > regards, tom lane Yes, VACUUM [full] alone did not help, but, as advised (thanks!), I've VACUUM ANALYZEd, and then it started using index on integer field1 and field2 as expected, but the index on real field3 is used only when I ask ordering, and a query like below remains seq. scan: trc=# explain select * from mytable where field3 = 0.1 limit 1; NOTICE: QUERY PLAN: Limit (cost=0.00..11.25 rows=1 width=12) -> Seq Scan on mytable (cost=0.00..182277.74 rows=16201 width=12) EXPLAIN trc=# Thilo Hille suggested that postgres uses sequential scans for queries when a huge number of affected rows is expected, but it uses seq.scan even when I ask for a value that is definitely out the range of values I have. Anyway, thanks for help, Mila
В списке pgsql-novice по дате отправления: