On 06/07/2011 04:38 AM, mark wrote:
> NOT EXISTS (with 64MB of work_mem)
> http://explain.depesz.com/s/EuX
Hash Anti Join (cost=443572.19..790776.84 rows=1 width=1560)
(actual time=16337.711..50358.487 rows=2196299 loops=1)
Note the estimated vs actual rows. Either your stats are completely
ridiculous, or the planner is confused.
What are your stats target levels? Have you tried increasing the stats
levels on the table(s) or at least column(s) affected? Or tweaking
default_statistics_target if you want to use a bigger hammer?
Is autovacuum being allowed to do its work and regularly ANALYZE the
database? Does an explicit 'ANALYZE' help?
--
Craig Ringer