Re: Different execution plan between PostgreSQL 8.4 and 12.11
Bruce Momjian <bruce@momjian.us>
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <dgrowleyml@gmail.com>, gzh <gzhcoder@126.com>, pgsql-general@lists.postgresql.org
Date: 2022-10-11T14:30:53Z
Lists: pgsql-general
On Tue, Oct 11, 2022 at 09:59:43AM -0400, Tom Lane wrote: > David Rowley <dgrowleyml@gmail.com> writes: > > It feels like something is a bit lacking in our cost model here. I'm > > just not sure what that is. > > The example you show is the same old problem that we've understood for > decades: for cost-estimation purposes, we assume that matching rows > are more or less evenly distributed in the table. Their actual > location doesn't matter that much if you're scanning the whole table; > but if you're hoping that a LIMIT will be able to stop after scanning > just a few rows, it does matter. We do have a correlation statistics value for each column but I am unclear if that would help here. -- Bruce Momjian <bruce@momjian.us> https://momjian.us EDB https://enterprisedb.com Indecision is a decision. Inaction is an action. Mark Batterson
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Use Limit instead of Unique to implement DISTINCT, when possible
- 5543677ec90a 16.0 landed