]> granicus.if.org Git - postgresql/commit
Postpone generating tlists and EC members for inheritance dummy children.
authorEtsuro Fujita <efujita@postgresql.org>
Mon, 21 Jan 2019 08:46:15 +0000 (17:46 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Mon, 21 Jan 2019 08:46:15 +0000 (17:46 +0900)
commitb10e3bba86731b53467b33533ca52a1d432163b2
tree9881779395cc47f6b8cfd52f8e52cc5b26431a26
parent0ec29785c52cfd400d3106d6606f150ed2356b11
Postpone generating tlists and EC members for inheritance dummy children.

Previously, in set_append_rel_size(), we generated tlists and EC members
for dummy children for possible use by partition-wise join, even if
partition-wise join was disabled or the top parent was not a partitioned
table, but adding such EC members causes noticeable planning speed
degradation for queries with certain kinds of join quals like
"(foo.x + bar.y) = constant" where foo and bar are partitioned tables in
cases where there are lots of dummy children, as the EC members lists
grow huge, especially for the ECs derived from such join quals, which
makes the search for the parent EC members in add_child_rel_equivalences()
very time-consuming.  Postpone the work until such children are actually
involved in a partition-wise join.

Reported-by: Sanyo Capobiango
Analyzed-by: Justin Pryzby and Alvaro Herrera
Author: Amit Langote, with a few additional changes by me
Reviewed-by: Ashutosh Bapat
Backpatch-through: v11 where partition-wise join was added
Discussion: https://postgr.es/m/CAO698qZnrxoZu7MEtfiJmpmUtz3AVYFVnwzR%2BpqjF%3DrmKBTgpw%40mail.gmail.com
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/joinrels.c