Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XFpdi-0002xl-L5 for pgsql-performance@arkaria.postgresql.org; Fri, 08 Aug 2014 19:15:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XFpdi-0000Jg-3n for pgsql-performance@arkaria.postgresql.org; Fri, 08 Aug 2014 19:15:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XFpdf-0000G9-Pq for pgsql-performance@postgresql.org; Fri, 08 Aug 2014 19:15:43 +0000 Received: from mx-out.zmailcloud.com ([192.198.85.98] helo=mx-out-1.zmailcloud.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XFpdc-0003ga-GM for pgsql-performance@postgresql.org; Fri, 08 Aug 2014 19:15:41 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id 2C184566451 for ; Fri, 8 Aug 2014 14:15:40 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 2686C6025F for ; Fri, 8 Aug 2014 14:15:40 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KTtrcZkI-dQV for ; Fri, 8 Aug 2014 14:15:40 -0500 (CDT) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 06B4560232 for ; Fri, 8 Aug 2014 14:15:40 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id E488C6025F for ; Fri, 8 Aug 2014 14:15:39 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BAM4wtzwborv for ; Fri, 8 Aug 2014 14:15:39 -0500 (CDT) Received: from [172.47.23.104] (70-36-143-82.dsl.dynamic.sonic.net [70.36.143.82]) by smtp-out-2.01.com (Postfix) with ESMTPSA id 93AC660232 for ; Fri, 8 Aug 2014 14:15:39 -0500 (CDT) Message-ID: <53E521D8.7090500@agliodbs.com> Date: Fri, 08 Aug 2014 12:15:36 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: postgres performance list Subject: Optimization idea for long IN() lists Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Folks, So one thing we tell users who have chronically long IN() lists is that they should create a temporary table and join against that instead. Other than not having the code, is there a reason why PostgreSQL shouldn't do something like this behind the scenes, automatically? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance