pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Vig, Sandor (G/FI-2) <Sandor.Vig@audi.hu>
Cc: pgsql-performance@postgresql.org
Subject: Re: IS NULL vs IS NOT NULL
Date: Fri, 25 Feb 2005 06:56:10 -0800 (PST)
Message-ID: <20050225065133.B92053@megazone.bigpanda.com> (raw)
In-Reply-To: <977921B17B2F2048AA5AAE9B4CBB713E01423D42@huaudigs0035.audi.de>
References: <977921B17B2F2048AA5AAE9B4CBB713E01423D42@huaudigs0035.audi.de>


On Fri, 25 Feb 2005, Vig, Sandor (G/FI-2) wrote:

> Hi,
>
> Another "funny" thing: I have a query which runs
> on (Linux) PostgreSQL 7.4.x under 10 sec. I tried
> to run it on (Windows) PostgreSQL 8.0 yesterday.
> It didn't finished at all! (I shoot it down after 10 minutes)
> I made various tests and I figured out something interesting:
> The same query with:
> 	A, "history.undo_action_id > 0" runs in 10 sec.
> 	B, "history.undo_action_id is not null" runs in 10 sec.
> 	C, "history.undo_action_id is null" runs forever (?!)
> I used EXPLAIN but I couldn't figure out what the problem was.

EXPLAIN ANALYZE would be more useful.  My first guess would be that the IS
NULL is returning many more than the estimated 1 row and as such a nested
loop is a bad plan.  How many history rows match type_id=6 and
undo_action_id is null?





view thread (2+ messages)

Message-ID: <20050225065133.B92053@megazone.bigpanda.com>
Permalink:  ../20050225065133.B92053@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20050225065133.B92053@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, Sandor.Vig@audi.hu
  Subject: Re: IS NULL vs IS NOT NULL
  In-Reply-To: <20050225065133.B92053@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox