Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jian Guo <gjian@vmware.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Hans Buschmann <buschmann@nidsa.net>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>,
Zhenghua Lyu <zlyu@vmware.com>
Date: 2023-11-20T02:42:31Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow examine_simple_variable() to work on INSERT RETURNING Vars.
- 89b69db82adf 17.0 landed
-
Extract column statistics from CTE references, if possible.
- f7816aec23ee 17.0 landed
-
Remove SQL regression tests for GUCs related to NO_SHOW_ALL
- dbe8a1726cfd 15.3 cited
Attachments
- v1-0001-Propagate-pathkeys-from-CTEs-up-to-the-outer-query.patch (application/octet-stream) patch v1-0001
On Fri, Nov 17, 2023 at 11:38 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > That line of argument also leads to the conclusion that it'd be > okay to expose info about the ordering of the CTE result to the > upper planner. This patch doesn't do that, and I'm not sufficiently > excited about the issue to go write some code. But if someone else > does, I think we shouldn't exclude doing it on the grounds of wanting > to preserve an optimization fence. The fence is sort of one-way > in this line of thinking: information can propagate up to the outer > planner level, but not down into the CTE plan. In the light of this conclusion, I had a go at propagating the pathkeys from CTEs up to the outer planner and came up with the attached. Comments/thoughts? Thanks Richard