From: Tom Lane <tgl@sss.pgh.pa.us>
To: gzh <gzhcoder@126.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Different execution plan between PostgreSQL 8.4 and 12.11
Date: Sun, 09 Oct 2022 12:02:09 -0400
Message-ID: <3810464.1665331329@sss.pgh.pa.us> (raw)
In-Reply-To: <23fe7e4b.5866.183bc03584f.Coremail.gzhcoder@126.com>
References: <23fe7e4b.5866.183bc03584f.Coremail.gzhcoder@126.com>
gzh <gzhcoder@126.com> writes:
> I run following sql in PostgreSQL 8.4 and PostgreSQL 12.11, it returns different execution plan.
Have you done an ANALYZE in the new database? The rowcount estimates
seem a lot different, leading me to guess that the newer installation
doesn't have good statistics yet.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, gzhcoder@126.com
Subject: Re: Different execution plan between PostgreSQL 8.4 and 12.11
In-Reply-To: <3810464.1665331329@sss.pgh.pa.us>
References: <23fe7e4b.5866.183bc03584f.Coremail.gzhcoder@126.com> <3810464.1665331329@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