Re: Different execution plan between PostgreSQL 8.4 and 12.11

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: gzh <gzhcoder@126.com>
Cc: pgsql-general@lists.postgresql.org
Date: 2022-10-10T02:45:54Z
Lists: pgsql-general
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



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Use Limit instead of Unique to implement DISTINCT, when possible