X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AA792D1B8BC for ; Thu, 21 Aug 2003 14:29:25 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 86262-01 for ; Thu, 21 Aug 2003 14:28:54 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 9280FD1B4E2 for ; Thu, 21 Aug 2003 14:28:53 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 34489D620; Thu, 21 Aug 2003 10:28:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 1FD305C02; Thu, 21 Aug 2003 10:28:53 -0700 (PDT) Date: Thu, 21 Aug 2003 10:28:53 -0700 (PDT) From: Stephan Szabo To: Dani Oderbolz Cc: Subject: Re: "SELECT IN" Still Broken in 7.4b In-Reply-To: <3F44995A.8040308@ecologic.de> Message-ID: <20030821102627.C51705-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/262 X-Sequence-Number: 14878 On Thu, 21 Aug 2003, Dani Oderbolz wrote: > Stephan Szabo wrote: > > >On Wed, 20 Aug 2003, Rod Taylor wrote: > >... > > > > > >>Is the temp table version any faster? I realize it has a higher limit > >>to the number of items you can have in the list. > >> > >> > > > >Within the scope of the new hashed IN stuff I believe so in at least some > >cases. I have a few million row table of integers where searching for > >values IN (~10000 values) takes longer than creating the temp table, > >copying into it and doing the in subquery. That's not a particularly > >meaningful test case, but sending the psql output to /dev/null gives me: ... > > > But where do your values come from in the first place? > Couldn't you optimize your model so that you don't have to copy around > such amounts of data? I wasn't the OP, I was doing a simple test as a comparison between the two forms of the queries to see if making a temp table and populating it and then doing the subselect form could ever be faster than the current conversion for valuelists to a sequence of or conditions. In 7.3, it probably was not possible for a conversion to in subselect to be faster, but with the new hash subquery stuff it was worth trying again.