Re: not exits slow compared to not in. (nested loops killing me) - Mailing list pgsql-performance

From Craig Ringer
Subject Re: not exits slow compared to not in. (nested loops killing me)
Date
Msg-id 4DED5DB5.4030309@postnewspapers.com.au
Whole thread Raw
In response to not exits slow compared to not in. (nested loops killing me)  (mark <dvlhntr@gmail.com>)
Responses Re: not exits slow compared to not in. (nested loops killing me)
Re: not exits slow compared to not in. (nested loops killing me)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.4/9.0 simple query performance regression
Next
From: Tom Lane
Date:
Subject: Re: not exits slow compared to not in. (nested loops killing me)