]> granicus.if.org Git - postgresql/commit
Optimize nested ConvertRowtypeExpr nodes.
authorAndrew Gierth <rhodiumtoad@postgresql.org>
Tue, 6 Nov 2018 14:19:40 +0000 (14:19 +0000)
committerAndrew Gierth <rhodiumtoad@postgresql.org>
Tue, 6 Nov 2018 21:10:10 +0000 (21:10 +0000)
commit5613da4cc7910f4b686b818dd1ee68703d62192f
tree521c49f6721a16acd808569139d1812720524e7d
parentc24dcd0cfd949bdf245814c4c2b3df828ee7db36
Optimize nested ConvertRowtypeExpr nodes.

A ConvertRowtypeExpr is used to translate a whole-row reference of a
child to that of a parent. The planner produces nested
ConvertRowtypeExpr while translating whole-row reference of a leaf
partition in a multi-level partition hierarchy. Executor then
translates the whole-row reference from the leaf partition into all
the intermediate parent's whole-row references before arriving at the
final whole-row reference. It could instead translate the whole-row
reference from the leaf partition directly to the top-most parent's
whole-row reference skipping any intermediate translations.

Ashutosh Bapat, with tests by Kyotaro Horiguchi and some
editorialization by me. Reviewed by Andres Freund, Pavel Stehule,
Kyotaro Horiguchi, Dmitry Dolgov, Tom Lane.
src/backend/optimizer/util/clauses.c
src/test/regress/expected/inherit.out
src/test/regress/sql/inherit.sql