Waiting for Postgres 17: Better Query Plans for Materialized CTE Scans

Ғылым және технология

Find the article on our blog here:
pganalyze.com/blog/5mins-post...
In E118 of "5mins of Postgres" we discuss two changes in the upcoming Postgres 17 release that improve query plans for queries that involve CTEs. This can improve query plans where you would see an explicit CTE scan, due to use of the MATERIALIZED keyword, or because Postgres wasn't able to pull up a query to the upper plan level.
Learn more about pganalyze:
pganalyze.com
pganalyze.com/newsletter
/ pganalyze
Check out the pganalyze library for eBooks, webinars, and more:
pganalyze.com/resources
📑 What we have discussed in this episode of 5mins of Postgres:
Extract column statistics from CTE references, if possible - Postgres commit by Tom Lane, co-authored by Jian Guo
git.postgresql.org/gitweb/?p=...
Wrong rows estimations with joins of CTEs slows queries by more than factor 500 - Mailinglist thread by Hans Buschmann on pgsql-hackers
www.postgresql.org/message-id...
BUG #18466: Wrong row estimate for nested loop - Mailinglist thread by Yan Wu on pgsql-bugs
www.postgresql.org/message-id...
Propagate pathkeys from CTEs up to the outer query - Postgres commit by Tom Lane, authored by Richard Guo
git.postgresql.org/gitweb/?p=...
Propagate pathkeys from CTEs up to the outer query - Mailinglist thread by Richard Guo on pgsql-hackers
www.postgresql.org/message-id...
What are the "tenk" and "onek" tables in the Postgres docs? - 5mins of Postgres E108 transcript
pganalyze.com/blog/5mins-post...
#postgres #postgresql #queryoptimization

Пікірлер: 2

  • @nurxg
    @nurxgАй бұрын

    What is CTE?

  • @pganalyze6516

    @pganalyze6516

    Ай бұрын

    CTE = Common Table Expression, or "WITH [name] AS ( SELECT ...) SELECT" in a query. See www.postgresql.org/docs/current/queries-with.html

Келесі