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

Function has_useful_pathkeys

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

* has_useful_pathkeys * Detect whether the specified rel could have any pathkeys that are * useful according to truncate_useless_pathkeys(). * * This is a cheap test that lets us skip building pathkeys at all in very * simple queries. It's OK to err in the direction of returning "true" when * there really aren't any usable pathkeys, but erring in the other direction * is bad --- so keep

Source from the content-addressed store, hash-verified

2511 * a sort are reasonably common, though, so this much work seems worthwhile.
2512 */
2513bool
2514has_useful_pathkeys(PlannerInfo *root, RelOptInfo *rel)
2515{
2516 if (rel->joininfo != NIL || rel->has_eclass_joins)
2517 return true; /* might be able to use pathkeys for merging */
2518 if (root->query_pathkeys != NIL)
2519 return true; /* might be able to use them for ordering */
2520 return false; /* definitely useless */
2521}

Callers 3

build_index_pathsFunction · 0.85
set_append_rel_sizeFunction · 0.85
build_child_join_relFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected