* 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
| 2511 | * a sort are reasonably common, though, so this much work seems worthwhile. |
| 2512 | */ |
| 2513 | bool |
| 2514 | has_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 | } |
no outgoing calls
no test coverage detected