Re: *very* inefficient choice made by the planner (regarding - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: *very* inefficient choice made by the planner (regarding
Date
Msg-id 20040610100332.D20710@megazone.bigpanda.com
Whole thread Raw
In response to Re: *very* inefficient choice made by the planner (regarding  (Jean-Luc Lachance <jllachan@sympatico.ca>)
Responses Re: *very* inefficient choice made by the planner (regarding  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List 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.


pgsql-performance by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: *very* inefficient choice made by the planner (regarding
Next
From: Stephan Szabo
Date:
Subject: Re: *very* inefficient choice made by the planner (regarding