* 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
| 1408 | * Returns the list of new path keys. |
| 1409 | */ |
| 1410 | List * |
| 1411 | build_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 | /**************************************************************************** |
no test coverage detected