Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yz60a-00018J-OB for pgsql-performance@arkaria.postgresql.org; Sun, 31 May 2015 16:22:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yz60Z-0003Ka-Du for pgsql-performance@arkaria.postgresql.org; Sun, 31 May 2015 16:22:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yz60Y-0003KU-KI for pgsql-performance@postgresql.org; Sun, 31 May 2015 16:22:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Yz60V-0002YS-7M for pgsql-performance@postgresql.org; Sun, 31 May 2015 16:22:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4VGMW4H000634; Sun, 31 May 2015 12:22:32 -0400 From: Tom Lane To: Tomas Vondra cc: pgsql-performance@postgresql.org Subject: Re: Different plan for very similar queries In-reply-to: <556B3160.2010706@2ndquadrant.com> References: <20150529085544.GA15813@hjp.at> <20150529095117.GB15813@hjp.at> <5568FAA5.3080807@2ndquadrant.com> <29819.1433012674@sss.pgh.pa.us> <20150531110010.GA25173@hjp.at> <556B3160.2010706@2ndquadrant.com> Comments: In-reply-to Tomas Vondra message dated "Sun, 31 May 2015 18:05:52 +0200" Date: Sun, 31 May 2015 12:22:32 -0400 Message-ID: <633.1433089352@sss.pgh.pa.us> 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 Tomas Vondra writes: > On 05/31/15 13:00, Peter J. Holzer wrote: >> (There was no analyze on facttable_stat_fta4 (automatic or manual) on >> facttable_stat_fta4 between those two tests, so the statistics on >> facttable_stat_fta4 shouldn't have changed - only those for term.) > So maybe there was autoanalyze, because otherwise it really should be > the same in both plans ... No, because that's the inside of a nestloop with significantly different outer-side rowcount estimates. The first case gets a benefit from the expectation that it will be re-executed many times (see the impact of loop_count on cost_index). regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance