MCPcopy Create free account
hub / github.com/apache/cloudberry / allow_star_schema_join

Function allow_star_schema_join

src/backend/optimizer/path/joinpath.c:465–476  ·  view source on GitHub ↗

* We override the param_source_rels heuristic to accept nestloop paths in * which the outer rel satisfies some but not all of the inner path's * parameterization. This is necessary to get good plans for star-schema * scenarios, in which a parameterized path for a large table may require * parameters from multiple small tables that will not get joined directly to * each other. We can handle

Source from the content-addressed store, hash-verified

463 * should be overridden, ie, it's okay to perform this join.
464 */
465static inline bool
466allow_star_schema_join(PlannerInfo *root,
467 Relids outerrelids,
468 Relids inner_paramrels)
469{
470 /*
471 * It's a star-schema case if the outer rel provides some but not all of
472 * the inner rel's parameterization.
473 */
474 return (bms_overlap(inner_paramrels, outerrelids) &&
475 bms_nonempty_difference(inner_paramrels, outerrelids));
476}
477
478/*
479 * paraminfo_get_equal_hashops

Callers 1

try_nestloop_pathFunction · 0.85

Calls 2

bms_overlapFunction · 0.85
bms_nonempty_differenceFunction · 0.85

Tested by

no test coverage detected