Re: Recursive optimization of IN subqueries

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "'Dennis Haney'" <davh(at)diku(dot)dk>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Recursive optimization of IN subqueries
Date: 2004-01-27 14:49:57
Message-ID: 002e01c3e4e4$d638a9e0$5e00030a@LaptopDellXP
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

My mistake then. Better to check than let a logical hole in. Thanks for
letting me know, Simon

-----Original Message-----
From: pgsql-hackers-owner(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Dennis Haney
Sent: Tuesday, January 27, 2004 14:33
To: simon(at)2ndquadrant(dot)com
Cc: 'Tom Lane'; pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Recursive optimization of IN subqueries

Simon Riggs wrote:

Tom Lane writes

In the second place, what the code is doing is dependent on an
understanding
of the semantics of IN; I'm not sure it's applicable to, say,
WHERE outervar > ANY (SELECT innervar FROM ...)
and it's definitely not applicable to
WHERE outervar > ALL (SELECT innervar FROM ...)
In particular, the optimization paths that involve unique-ifying the
subselect output and then using it as the outer side of a join would
definitely not work for these sorts of things.


I'm not sure if I've understood you correctly in the section above. Are
you saying that these types of queries don't have a meaningful or
defined response? Or just that they wouldn't be very well optimized as a
result of the unique-ifying code changes? Or have I just mis-read the
thread...

I think Tom is refering to the context of the specific optimization.
The optimization we are discussing does nothing to correlated
subqueries, and a uncorrolated subquery with > ALL/ANY is actually a
computed constant and not a join.

--
Dennis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2004-01-27 14:50:16 Re: Foreign keys on inherited attributes
Previous Message Dennis Haney 2004-01-27 14:32:54 Re: Recursive optimization of IN subqueries

Browse pgsql-hackers by date

  From Date Subject
Next Message Dennis Haney 2004-01-27 16:27:25 Another optimizer question
Previous Message Dennis Haney 2004-01-27 14:32:54 Re: Recursive optimization of IN subqueries