1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Tweak a couple of planner APIs to save recalculating join relids.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se
This commit is contained in:
Tom Lane
2018-04-20 16:00:47 -04:00
parent c792c7db41
commit ec38dcd363
5 changed files with 16 additions and 9 deletions

View File

@ -171,6 +171,7 @@ add_paths_to_joinrel(PlannerInfo *root,
break;
case JOIN_UNIQUE_OUTER:
extra.inner_unique = innerrel_is_unique(root,
joinrel->relids,
outerrel->relids,
innerrel,
JOIN_INNER,
@ -179,6 +180,7 @@ add_paths_to_joinrel(PlannerInfo *root,
break;
default:
extra.inner_unique = innerrel_is_unique(root,
joinrel->relids,
outerrel->relids,
innerrel,
jointype,
@ -207,7 +209,7 @@ add_paths_to_joinrel(PlannerInfo *root,
* for cost estimation. These will be the same for all paths.
*/
if (jointype == JOIN_SEMI || jointype == JOIN_ANTI || extra.inner_unique)
compute_semi_anti_join_factors(root, outerrel, innerrel,
compute_semi_anti_join_factors(root, joinrel, outerrel, innerrel,
jointype, sjinfo, restrictlist,
&extra.semifactors);