Received: from sid.trust.ee (sid.trust.ee [194.204.23.180]) by hub.org (8.8.8/8.7.5) with ESMTP id EAA04330; Thu, 16 Jul 1998 04:40:51 -0400 (EDT) Received: from trust.ee (wink.trust.ee [194.204.23.184]) by sid.trust.ee (8.8.7/8.8.7) with ESMTP id LAA02686; Thu, 16 Jul 1998 11:38:30 +0300 Message-ID: <35ADBCCB.3B1FB91B@trust.ee> Date: Thu, 16 Jul 1998 11:41:47 +0300 From: Hannu Krosing X-Mailer: Mozilla 4.05 [en] (Win95; I) MIME-Version: 1.0 To: Bruce Momjian CC: David Hartwig , pgsql-interfaces@postgreSQL.org, hackers@postgreSQL.org Subject: Re: [INTERFACES] Re: [HACKERS] changes in 6.4 References: <199807152339.TAA07145@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bruce Momjian wrote: > > > The results are profound. Queries that used to scan tables because of the > > How about if instead of doing: > > select * from tab1 where val = 3 > union > select * from tab1 where val = 4 > ... > > you change it to: > > select * from tab1 where val in ( > select 3 > union > select 4 > ) > the explosion happens for ORs of multiple ANDs that get rewritten to: select * from tabl wehere val1=1 and val2=1 and val3=1 union select * from tabl wehere val1=1 and val2=1 and val3=2 union ... And there is no way of doing (at least presently): select * from table where (val1,val2,val3) in (select 1,1,1 union select 1,1,2); Hannu