X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7991252A4F for ; Tue, 22 Mar 2005 17:34:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09319-02 for ; Tue, 22 Mar 2005 17:34:36 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 2023F56A0D for ; Tue, 22 Mar 2005 17:34:35 +0000 (GMT) Received: (qmail 13223 invoked by uid 500); 22 Mar 2005 17:50:56 -0000 Date: Tue, 22 Mar 2005 11:50:56 -0600 From: Bruno Wolff III To: Gourish Singbal Cc: PgSQL Admin Subject: Re: Whats the limit on the number of elements in the IN clause of SELECT/UPDATE/DELETE Message-ID: <20050322175056.GA12999@wolff.to> Mail-Followup-To: Bruno Wolff III , Gourish Singbal , PgSQL Admin References: <674d1f8a0503220822307d6f52@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <674d1f8a0503220822307d6f52@mail.gmail.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/346 X-Sequence-Number: 16844 On Tue, Mar 22, 2005 at 21:52:35 +0530, Gourish Singbal wrote: > Can some one give me the details for the below question?. > > Whats the limit on the number of elements in the IN clause of > SELECT/UPDATE/DELETE?. I believe I have seen reports of people using thousands. However, since this case is converted to OR, it won't be particular fast when you have a number of values. In that case you are going to be better off loading them into a temp table, analyzing the table and then using IN with a subselect (and you want to be using 7.4 or later).