Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 070789FB3F4 for ; Fri, 18 May 2007 00:46:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 03520-02 for ; Fri, 18 May 2007 00:46:25 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id A68B29FB69E for ; Fri, 18 May 2007 00:46:25 -0300 (ADT) Thread-Index: AceY/yUneSPYgyRsTzqu29G9gqbWyg== Received: from [59.95.21.43] ([59.95.21.43]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 17 May 2007 23:46:40 -0400 Message-ID: <464D21CD.5060907@enterprisedb.com> Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826 Importance: normal Date: Fri, 18 May 2007 09:17:25 +0530 From: "Atul Deopujari" User-Agent: Thunderbird 2.0a1 (X11/20060724) MIME-Version: 1.0 To: "Tom Lane" Cc: "Atul Deopujari" , "Neil Conway" , Subject: Re: Planning large IN lists References: <1178821226.6034.63.camel@goldbach> <19001.1178823208@sss.pgh.pa.us> <464C1CA0.1060705@enterprisedb.com> <23045.1179408878@sss.pgh.pa.us> <464CA680.7040904@enterprisedb.com> <12592.1179432985@sss.pgh.pa.us> In-Reply-To: <12592.1179432985@sss.pgh.pa.us> Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 May 2007 03:46:40.0703 (UTC) FILETIME=[24EE54F0:01C798FF] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/815 X-Sequence-Number: 103417 Tom Lane wrote: > "Atul Deopujari" writes: >> Yes, letting the planner make its own decision would seem best (in >> accordance with what we do for different join paths). But for large IN >> lists, a substantial part of the planner is spent in estimating the >> selectivity of the ScalarArrayExpr by calling scalararraysel. If we are >> not eliminating this step in processing the IN list then we are not >> doing any optimization. Asking the planner to do scalararraysel and also >> compute cost of any other way and choose between the two is asking >> planner to do more work. > > So? Better planning usually involves more work. In any case the above > argument seems irrelevant, because making scalararraysel more > approximate and less expensive for long lists could be done > independently of anything else. > Got you and agree with you. -- Atul EnterpriseDB www.enterprisedb.com