git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: e0d0529) | patch
Centralize collection of catalog info needed early in the planner
2025年7月22日 02:20:40 +0000 (11:20 +0900)
2025年7月22日 02:20:40 +0000 (11:20 +0900)
commit 904f6a593a06649f77597ab9a72ef97c21e39a93
Centralize collection of catalog info needed early in the planner

There are several pieces of catalog information that need to be
retrieved for a relation during the early stage of planning. These
include relhassubclass, which is used to clear the inh flag if the
relation has no children, as well as a column's attgenerated and
default value, which are needed to expand virtual generated columns.
More such information may be required in the future.

Currently, these pieces of catalog data are collected in multiple
places, resulting in repeated table_open/table_close calls for each
relation in the rangetable. This patch centralizes the collection of
all required early-stage catalog information into a single loop over
the rangetable, allowing each relation to be opened and closed only
once.

Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAMbWs4-bFJ1At4btk5wqbezdu8PLtQ3zv-aiaY3ry9Ymm=jgFQ@mail.gmail.com
src/backend/optimizer/plan/planner.c diff | blob | blame | history
src/backend/optimizer/plan/subselect.c diff | blob | blame | history
src/backend/optimizer/prep/prepjointree.c diff | blob | blame | history
src/include/optimizer/prep.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /