* Find input-tuple columns that are needed, dividing them into * aggregated and unaggregated sets. */
| 1446 | * aggregated and unaggregated sets. |
| 1447 | */ |
| 1448 | static void |
| 1449 | find_cols(AggState *aggstate, Bitmapset **aggregated, Bitmapset **unaggregated) |
| 1450 | { |
| 1451 | Agg *agg = (Agg *) aggstate->ss.ps.plan; |
| 1452 | FindColsContext context; |
| 1453 | |
| 1454 | context.is_aggref = false; |
| 1455 | context.aggregated = NULL; |
| 1456 | context.unaggregated = NULL; |
| 1457 | |
| 1458 | /* Examine tlist and quals */ |
| 1459 | (void) find_cols_walker((Node *) agg->plan.targetlist, &context); |
| 1460 | (void) find_cols_walker((Node *) agg->plan.qual, &context); |
| 1461 | |
| 1462 | /* In some cases, grouping columns will not appear in the tlist */ |
| 1463 | for (int i = 0; i < agg->numCols; i++) |
| 1464 | context.unaggregated = bms_add_member(context.unaggregated, |
| 1465 | agg->grpColIdx[i]); |
| 1466 | |
| 1467 | *aggregated = context.aggregated; |
| 1468 | *unaggregated = context.unaggregated; |
| 1469 | } |
| 1470 | |
| 1471 | static bool |
| 1472 | find_cols_walker(Node *node, FindColsContext *context) |
no test coverage detected