* cdbpullup_truncatePathKeysForTargetList * * Truncate a list of pathkeys to only those that can be evaluated * using the given target list. */
| 341 | * using the given target list. |
| 342 | */ |
| 343 | List * |
| 344 | cdbpullup_truncatePathKeysForTargetList(List *pathkeys, List *targetlist) |
| 345 | { |
| 346 | List *new_pathkeys = NIL; |
| 347 | ListCell *lc; |
| 348 | |
| 349 | foreach(lc, pathkeys) |
| 350 | { |
| 351 | PathKey *pk = (PathKey *) lfirst(lc); |
| 352 | |
| 353 | if (!cdbpullup_findEclassInTargetList(pk->pk_eclass, targetlist, InvalidOid, NULL)) |
| 354 | break; |
| 355 | |
| 356 | new_pathkeys = lappend(new_pathkeys, pk); |
| 357 | } |
| 358 | |
| 359 | return new_pathkeys; |
| 360 | } |
| 361 | |
| 362 | /* |
| 363 | * cdbpullup_make_var |
no test coverage detected