pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Jean-Luc Lachance <jllachan@sympatico.ca>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org, Frank van Vugt <ftm.van.vugt@foxi.nl>
Subject: Re: *very* inefficient choice made by the planner (regarding
Date: Thu, 10 Jun 2004 10:09:07 -0700 (PDT)
Message-ID: <20040610100332.D20710@megazone.bigpanda.com> (raw)
In-Reply-To: <40C892BA.8080704@sympatico.ca>
References: <200406101624.21739.ftm.van.vugt@foxi.nl>
	<40C881FE.5000301@sympatico.ca>
	<25304.1086883145@sss.pgh.pa.us>
	<40C892BA.8080704@sympatico.ca>


On Thu, 10 Jun 2004, Jean-Luc Lachance wrote:

> I agree, but it should be a simple rewrite. No?

It's NULLs inside the subselect that are the issue.

select 1 in (select a from foo)
select exists ( select 1 from foo where a=1)

If foo.a contains a row with NULL but no rows containing a 1, the above
give different results (unknown and exists) and IIRC, exists cannot
return unknown, so there's no simple rewrite of the subselect that gives
equivalent behavior.




view thread (12+ messages)  latest in thread

Message-ID: <20040610100332.D20710@megazone.bigpanda.com>
Permalink:  ../20040610100332.D20710@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040610100332.D20710@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, jllachan@sympatico.ca, tgl@sss.pgh.pa.us, ftm.van.vugt@foxi.nl
  Subject: Re: *very* inefficient choice made by the planner (regarding
  In-Reply-To: <20040610100332.D20710@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