* targetIsInAllPartitionLists * True if the TargetEntry is listed in the PARTITION BY clause * of every window defined in the query. * * It would be safe to ignore windows not actually used by any window * function, but it's not easy to get that info at this stage; and it's * unlikely to be useful to spend any extra cycles getting it, since * unreferenced window definitions are probably i
| 4316 | * unreferenced window definitions are probably infrequent in practice. |
| 4317 | */ |
| 4318 | static bool |
| 4319 | targetIsInAllPartitionLists(TargetEntry *tle, Query *query) |
| 4320 | { |
| 4321 | ListCell *lc; |
| 4322 | |
| 4323 | foreach(lc, query->windowClause) |
| 4324 | { |
| 4325 | WindowClause *wc = (WindowClause *) lfirst(lc); |
| 4326 | |
| 4327 | if (!targetIsInSortList(tle, InvalidOid, wc->partitionClause)) |
| 4328 | return false; |
| 4329 | } |
| 4330 | return true; |
| 4331 | } |
| 4332 | |
| 4333 | /* |
| 4334 | * qual_is_pushdown_safe - is a particular rinfo safe to push down? |
no test coverage detected