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

Function build_join_pathkeys

src/backend/optimizer/path/pathkeys.c:1410–1429  ·  view source on GitHub ↗

* build_join_pathkeys * Build the path keys for a join relation constructed by mergejoin or * nestloop join. This is normally the same as the outer path's keys. * * EXCEPTION: in a FULL or RIGHT join, we cannot treat the result as * having the outer path's path keys, because null lefthand rows may be * inserted at random points. It must be treated as unsorted. * * We truncate

Source from the content-addressed store, hash-verified

1408 * Returns the list of new path keys.
1409 */
1410List *
1411build_join_pathkeys(PlannerInfo *root,
1412 RelOptInfo *joinrel,
1413 JoinType jointype,
1414 List *outer_pathkeys)
1415{
1416 if (jointype == JOIN_FULL || jointype == JOIN_RIGHT)
1417 return NIL;
1418
1419 /*
1420 * This used to be quite a complex bit of code, but now that all pathkey
1421 * sublists start out life canonicalized, we don't have to do a darn thing
1422 * here!
1423 *
1424 * We do, however, need to truncate the pathkeys list, since it may
1425 * contain pathkeys that were useful for forming this joinrel but are
1426 * uninteresting to higher levels.
1427 */
1428 return truncate_useless_pathkeys(root, joinrel, outer_pathkeys);
1429}
1430
1431
1432/****************************************************************************

Callers 4

sort_inner_and_outerFunction · 0.85
match_unsorted_outerFunction · 0.85

Calls 1

Tested by

no test coverage detected