Re: *very* inefficient choice made by the planner (regarding

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Jean-Luc Lachance <jllachan(at)sympatico(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org, Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Subject: Re: *very* inefficient choice made by the planner (regarding
Date: 2004-06-10 17:09:07
Message-ID: 20040610100332.D20710@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephan Szabo 2004-06-10 17:14:36 Re: *very* inefficient choice made by the planner (regarding
Previous Message Jean-Luc Lachance 2004-06-10 16:56:26 Re: *very* inefficient choice made by the planner (regarding