[PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread James Russell
Hi there, I'm running a simple query with 2 inner joins (say A, B and C). Each of the join columns has indexes. If I run queries that join just A and B, or just B and C, postgres uses indexes. But if I run A join B join C then the B join C part starts using a sequential scan and I can't figure

Re: [PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread Joshua D. Drake
Explaining: Hash Join (cost=337.93..1267.54 rows=180 width=35) Hash Cond: (outer.message_id = inner.message_id) - Seq Scan on message_meta_data (cost=0.00..739.19 rows=37719 width=30) - Hash (cost=337.79..337.79 rows=57 width=13) - Nested Loop (cost=0.00..337.79 rows=57 width=13)

Re: [PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread Michael Fuhr
On Tue, Jan 31, 2006 at 07:29:51PM -0800, Joshua D. Drake wrote: Any ideas? What does explain analyze say? Also, have the tables been vacuumed and analyzed? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread James Russell
[Sorry, my last reply didn't go to the list] Reading about this issue further in the FAQ, it seems that I should ensure that Postgres has adequate and accurate information about the tables in question by regularly running VACUUM ANALYZE, something I don't do currently. I disabled SeqScan as

Re: [PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread Michael Fuhr
On Wed, Feb 01, 2006 at 01:33:08PM +0900, James Russell wrote: Reading about this issue further in the FAQ, it seems that I should ensure that Postgres has adequate and accurate information about the tables in question by regularly running VACUUM ANALYZE, something I don't do currently. Many