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 774D0D1BA10 for ; Wed, 20 Aug 2003 16:31:22 -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 69808-04 for ; Wed, 20 Aug 2003 16:31:13 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 2FAEAD1B989 for ; Wed, 20 Aug 2003 16:31:11 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 35621; Wed, 20 Aug 2003 11:48:34 -0700 Message-ID: <3F43CAF1.9050405@joeconway.com> Date: Wed, 20 Aug 2003 12:24:33 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mike Winter Cc: pgsql-sql@postgresql.org Subject: Re: "SELECT IN" Still Broken in 7.4b References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/234 X-Sequence-Number: 14850 Mike Winter wrote: > On Wed, 20 Aug 2003, Rod Taylor wrote: > >>Ensure your IN list is unique. You might find better times by through >>an indexed temp table. > > That is what I ended up doing, but it's not a very elegant solution. > MySQL does queries of this type orders of magnitudes faster than Postgres > on large value lists, although I have no specific algorithmic solutions to > offer for how to make it faster. I don't believe making the IN lists > unique has any affect on performance. > I have no idea whether it will be better or worse performance, but in 7.4 you could do: select blah from foo where id = any (ARRAY[list_of_literals]); Joe