Re: Damn slow query - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Damn slow query
Date
Msg-id 200210092233.g99MXeH07489@candle.pha.pa.us
Whole thread Raw
In response to Re: Damn slow query  ("Magnus Naeslund(f)" <mag@fbab.net>)
List pgsql-hackers
Magnus Naeslund(f) wrote:
> Joe Conway <mail@joeconway.com> wrote:
> > "IN (subselect)" is notoriously slow (in fact it is an FAQ). Can you
> > rewrite this as:
> >
> 
> ...
> 
> Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:
> > Per FAQ suggestion, try something like
> 
> ...
> 
> Thanks alot, below are the results on your suggestions, quite an
> dramatic differance (but this is another box, faster, and running 7.3b2
> so the 45 minutes doesn't hold here, but it took more than 10 minutes
> before i stopped the original query).
> 
> Is this an todo item, or should every user figure this out (yeah i know
> i should have read the FAQ when it went so totally bad).
> The NOT IN it seems quite natural here, but then again, i don't think as
> the db as you do :)

We already have a TODO item:
* Allow Subplans to use efficient joins(hash, merge) with upper variable

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: "Magnus Naeslund(f)"
Date:
Subject: Re: Damn slow query
Next
From: "Magnus Naeslund(f)"
Date:
Subject: Re: Damn slow query