Re: [PERFORM] switchover between index and sequential scans

2008-07-03 Thread Abhijit Menon-Sen
Hi Greg. At 2008-07-03 11:05:46 +0100, [EMAIL PROTECTED] wrote: > > And increase the statistics target on header_fields and re-analyze? Aha! Thanks for the tip. I just changed the default_statistics_target to 100 (from 10) and ANALYSEd header_fields and mailbox_messages, and now it ALWAYS uses th

[PERFORM] switchover between index and sequential scans

2008-07-03 Thread Abhijit Menon-Sen
Hi. I have a table with 1.8M rows on a Postgres 8.1.4 server, and I'm executing a query which looks like: select count(*) from header_fields where message in (select message from mailbox_messages limit N); I've found that when N==75, the query uses a fast index scan, but when N==100, it

Re: [PERFORM] 10x rowcount mis-estimation favouring merge over nestloop

2006-11-09 Thread Abhijit Menon-Sen
At 2006-11-10 01:15:24 -0500, [EMAIL PROTECTED] wrote: > > it seems that "field<=12" is true for a much smaller fraction of the > rows satisfying (part!='' or value ilike '%,%') than for the general > population of rows in the header_fields table. Indeed. One-sixth of the rows in the entire table

[PERFORM] 10x rowcount mis-estimation favouring merge over nestloop

2006-11-09 Thread Abhijit Menon-Sen
I'm executing the following query: select hf.mailbox,hf.uid,hf.position,hf.part,hf.field,hf.value, af.address,a.name,a.localpart,a.domain from header_fields hf left join address_fields af using ( mailbox, uid, position, part, field ) left