* build_child_join_rel * Builds RelOptInfo representing join between given two child relations. * * 'outer_rel' and 'inner_rel' are the RelOptInfos of child relations being * joined * 'parent_joinrel' is the RelOptInfo representing the join between parent * relations. Some of the members of new RelOptInfo are produced by * translating corresponding members of this RelOptInfo * 'sjinfo
| 1220 | * 'jointype' is the join type (inner, left, full, etc) |
| 1221 | */ |
| 1222 | RelOptInfo * |
| 1223 | build_child_join_rel(PlannerInfo *root, RelOptInfo *outer_rel, |
| 1224 | RelOptInfo *inner_rel, RelOptInfo *parent_joinrel, |
| 1225 | List *restrictlist, SpecialJoinInfo *sjinfo, |
| 1226 | JoinType jointype) |
| 1227 | { |
| 1228 | RelOptInfo *joinrel = makeNode(RelOptInfo); |
| 1229 | AppendRelInfo **appinfos; |
| 1230 | int nappinfos; |
| 1231 | |
| 1232 | /* Only joins between "other" relations land here. */ |
| 1233 | Assert(IS_OTHER_REL(outer_rel) && IS_OTHER_REL(inner_rel)); |
| 1234 | |
| 1235 | /* The parent joinrel should have consider_partitionwise_join set. */ |
| 1236 | Assert(parent_joinrel->consider_partitionwise_join); |
| 1237 | |
| 1238 | joinrel->reloptkind = RELOPT_OTHER_JOINREL; |
| 1239 | joinrel->relids = bms_union(outer_rel->relids, inner_rel->relids); |
| 1240 | joinrel->rows = 0; |
| 1241 | /* cheap startup cost is interesting iff not all tuples to be retrieved */ |
| 1242 | joinrel->consider_startup = (root->tuple_fraction > 0); |
| 1243 | joinrel->consider_param_startup = false; |
| 1244 | joinrel->consider_parallel = false; |
| 1245 | joinrel->reltarget = create_empty_pathtarget(); |
| 1246 | joinrel->pathlist = NIL; |
| 1247 | joinrel->ppilist = NIL; |
| 1248 | joinrel->partial_pathlist = NIL; |
| 1249 | joinrel->cheapest_startup_path = NULL; |
| 1250 | joinrel->cheapest_total_path = NULL; |
| 1251 | joinrel->cheapest_unique_path = NULL; |
| 1252 | joinrel->cheapest_parameterized_paths = NIL; |
| 1253 | joinrel->direct_lateral_relids = NULL; |
| 1254 | joinrel->lateral_relids = NULL; |
| 1255 | joinrel->relid = 0; /* indicates not a baserel */ |
| 1256 | joinrel->rtekind = RTE_JOIN; |
| 1257 | joinrel->min_attr = 0; |
| 1258 | joinrel->max_attr = 0; |
| 1259 | joinrel->attr_needed = NULL; |
| 1260 | joinrel->attr_widths = NULL; |
| 1261 | joinrel->lateral_vars = NIL; |
| 1262 | joinrel->lateral_referencers = NULL; |
| 1263 | joinrel->indexlist = NIL; |
| 1264 | joinrel->pages = 0; |
| 1265 | joinrel->tuples = 0; |
| 1266 | joinrel->allvisfrac = 0; |
| 1267 | joinrel->eclass_indexes = NULL; |
| 1268 | joinrel->subroot = NULL; |
| 1269 | joinrel->subplan_params = NIL; |
| 1270 | joinrel->amflags = 0; |
| 1271 | joinrel->serverid = InvalidOid; |
| 1272 | joinrel->segSeverids = NIL; |
| 1273 | joinrel->userid = InvalidOid; |
| 1274 | joinrel->useridiscurrent = false; |
| 1275 | joinrel->fdwroutine = NULL; |
| 1276 | joinrel->fdw_private = NULL; |
| 1277 | joinrel->baserestrictinfo = NIL; |
| 1278 | joinrel->baserestrictcost.startup = 0; |
| 1279 | joinrel->baserestrictcost.per_tuple = 0; |
no test coverage detected