On Jan 22, 2008 11:22 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > > So I wonder why the stats were so bad... I didn't update the data at > > all after the initial import. Any idea? > > Hmm, perhaps the analyze was done with the default statistic target (10)?
It's set to 30 in the postgresql.conf from the beginning (= at least 3 weeks) and PostgreSQL has been restarted a few times (at least for the upgrade to RC2) so I don't think it's a configuration problem. I just set default_statistics_target to 10 and run a few ANALYZE+EXPLAIN ANALYZE query and the plan is the good one for all the runs. It's set to 10 on the 8.1 box by the way. I can't drop/recreate the database at will because the customer is also testing it but I'll try to find a moment to do it tomorrow. -- Guillaume ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match