Re: [HACKERS] Planning for improved versions of IN/NOT IN

2002-11-30 Thread Mike Mascari
Tom Lane wrote: Mike Mascari <[EMAIL PROTECTED]> writes: I curious if any of the rewriting of EXISTS and NOT EXISTS would address the problem described by Date: That should read "I'm curious"... http://www.firstsql.com/iexist.htm We are not here to redefine the SQL spec ... and especia

Re: [HACKERS] Planning for improved versions of IN/NOT IN

2002-11-29 Thread Tom Lane
Mike Mascari <[EMAIL PROTECTED]> writes: > I curious if any of the rewriting of EXISTS and NOT EXISTS would > address the problem described by Date: > http://www.firstsql.com/iexist.htm We are not here to redefine the SQL spec ... and especially not to eliminate its concept of NULL, which is wha

Re: [HACKERS] Planning for improved versions of IN/NOT IN

2002-11-29 Thread Mike Mascari
Joe Conway wrote: Tom Lane wrote: I've been thinking about how to improve the performance of queries using "WHERE x IN (subselect)" and "WHERE x NOT IN (subselect)". How about starting with a rule-based method to make the choice? 1. If uncorrelated: use hash-based approach - ISTM this might a

Re: [HACKERS] Planning for improved versions of IN/NOT IN

2002-11-29 Thread Joe Conway
Tom Lane wrote: I've been thinking about how to improve the performance of queries using "WHERE x IN (subselect)" and "WHERE x NOT IN (subselect)". In the existing implementation, the subquery result is rescanned to look for a match to x each time the WHERE clause is executed; this essentially ma

Re: [HACKERS] Planning for improved versions of IN/NOT IN

2002-11-27 Thread Tom Lane
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: > What about in the case of a scalar subquery eg. SELECT x IN > (1,2,3,4,54,56,6), when there maybe hundreds of scalars? Unrelated to my present problem. regards, tom lane ---(end of broadcast)-

Re: [HACKERS] Planning for improved versions of IN/NOT IN

2002-11-27 Thread Christopher Kings-Lynne
> The difficulty is that it's not clear how to choose one of these four > ways, short of planning the *entire* query from scratch all four ways :-(. > This seems pretty grim. Approaches #2 and #3 could be handled as local > transformations of the WHERE clause, but we couldn't choose which to use >

[HACKERS] Planning for improved versions of IN/NOT IN

2002-11-27 Thread Tom Lane
I've been thinking about how to improve the performance of queries using "WHERE x IN (subselect)" and "WHERE x NOT IN (subselect)". In the existing implementation, the subquery result is rescanned to look for a match to x each time the WHERE clause is executed; this essentially makes it work like