Karl Denninger <k...@denninger.net> wrote:
Kevin Grittner wrote:
 
>> I suspect that the above might do pretty well in 8.4.
 
> "Exists" can be quite slow.  So can "not exists"
> 
> See if you can re-write it using a sub-select - just replace the
> "exists ...." with "(select ...) is not null"
> 
> Surprisingly this often results in a MUCH better query plan under
> Postgresql.  Why the planner evaluates it "better" eludes me (it
> shouldn't) but the differences are often STRIKING - I've seen
> factor-of-10 differences in execution performance.
 
Have you seen such a difference under 8.4?  Can you provide a
self-contained example?
 
-Kevin

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Reply via email to