From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Different plan for very similar queries
Date: Sun, 31 May 2015 12:22:32 -0400
Message-ID: <633.1433089352@sss.pgh.pa.us> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Tomas Vondra <tomas.vondra@2ndquadrant.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com
Subject: Re: Different plan for very similar queries
In-Reply-To: <633.1433089352@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox