You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Improve performance of adjust_appendrel_attrs_multilevel.
The present implementations of adjust_appendrel_attrs_multilevel andits sibling adjust_child_relids_multilevel are very messy, becausethey work by reconstructing the relids of the child's immediateparent and then seeing if that's bms_equal to the relids of thetarget parent. Aside from being quite inefficient, this will notwork with planned future changes to make joinrels' relid setscontain outer-join relids in addition to baserels.The whole thing can be solved at a stroke by adding explicit parentand top_parent links to child RelOptInfos, and making these functionswork with RelOptInfo pointers instead of relids. Doing that issimpler for most callers, too.In my original version of this patch, I got rid ofRelOptInfo.top_parent_relids on the grounds that it was now redundant.However, that adds a lot of code churn in places that otherwise wouldnot need changing, and arguably the extra indirection needed to fetchtop_parent->relids in those places costs something. So this versionleaves that field in place.Discussion:https://postgr.es/m/553080.1657481916@sss.pgh.pa.us