Re: Bug in optimizer - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: Bug in optimizer
Date
Msg-id 20040504163619.GB10698@wolff.to
Whole thread Raw
List pgsql-performance
On Mon, May 03, 2004 at 18:08:23 +0200,
  Timo Nentwig <timo@nitwit.de> wrote:
>
> This is very slow:

This kind of question should be asked on the performance list.

>
> SELECT urls.id FROM urls WHERE
> (
>     urls.id <> ALL (SELECT html.urlid FROM html)
> );
>
> ...while this is quite fast:

You didn't provide your postgres version or an explain analyze so it is hard
to answer your question definitivly. Most likely you are using a pre 7.4
version which is know to be slow for IN (which is what the above probably
gets translated to).

>
> SELECT urls.id FROM urls WHERE
> (
>     NOT (EXISTS (SELECT html.urlid FROM tml WHERE
>     (
>         html.urlid = urls.id
>     )))
> );

pgsql-performance by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: cache table
Next
From: Greg Stark
Date:
Subject: Re: cache table