Re: [PERFORM] Query not using Index

2016-03-26 Thread Andreas Kretschmer
Wei Shan wrote: > Hi all, > > Please provide some advise on the following query not using the index: > I have 2 questions: > > 1. Why does the optimizer chose not to use the index when it will run faster? because of the estimated costs.: Seq Scan on testdb auditrecor0_  (cost=0.00..18147465.

[PERFORM] Query not using Index

2016-03-26 Thread Wei Shan
Hi all, Please provide some advise on the following query not using the index: pgsql version: 9.2.4 OS version: RedHat 6.5 Ram: 64 GB rows in testdb: 180 million shared_buffers: 16GB effective_cache_size: 32GB work_mem='32MB' I have executed the query below after I vaccum analyze the table. I h