pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 22:45:54 -0400
Message-ID: <3977622.1665369954@sss.pgh.pa.us> (raw)
In-Reply-To: <3bb0d13f.1d81.183bfbcf7e4.Coremail.gzhcoder@126.com>
References: <23fe7e4b.5866.183bc03584f.Coremail.gzhcoder@126.com>
	<3810464.1665331329@sss.pgh.pa.us>
	<3bb0d13f.1d81.183bfbcf7e4.Coremail.gzhcoder@126.com>

gzh  <gzhcoder@126.com> writes:
> I've run analyze(not vacuum analyze), but it doesn't seem to work.

When you're asking for help, please don't give us vague statements
like "doesn't seem to work".  Did the plan (including rowcount
estimates) change at all?  To what?  How far off is that rowcount
estimate, anyway --- that is, how many rows actually have cseid = 94?

If the estimate is far off, then increasing the table's statistics
target might help.

Another thing that would be worth checking is whether
"set enable_seqscan = off" prods it to choose the plan you want.
If not, then there's something else going on besides poor estimates.

			regards, tom lane





view thread (35+ messages)  latest in thread

Message-ID: <3977622.1665369954@sss.pgh.pa.us>
Permalink:  ../3977622.1665369954@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3977622.1665369954@sss.pgh.pa.us

 · 

reply

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: <3977622.1665369954@sss.pgh.pa.us>
  References: <23fe7e4b.5866.183bc03584f.Coremail.gzhcoder@126.com> <3810464.1665331329@sss.pgh.pa.us> <3bb0d13f.1d81.183bfbcf7e4.Coremail.gzhcoder@126.com> <3977622.1665369954@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