![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Compute the aggregation of q in a subquery, and its windows over that subquery's columns.
More...

Public Attributes | |
| const constants_t * | constants |
| Query * | q |
| The query whose windows are rewritten. | |
| bool | rewritten |
| One was. | |
| bool | declined |
| One could not be. | |
Compute the aggregation of q in a subquery, and its windows over that subquery's columns.
A window that reads an aggregate of its own query level – rank() OVER (ORDER BY count(*)), sum(count(*)) OVER () – is the window over the rows of the aggregation, which the rewritings read as a relation of its own: the aggregation moves to a subquery exposing its grouping columns and its aggregates, and the query keeps the windows, over those columns. The rank of a window over an aggregate result is then rewritten (rewrite_rank_over_aggregate).
Returns NULL, leaving q alone, when no window reads an aggregate of q, or on a shape it does not split (a DISTINCT, an ORDER BY or a LIMIT of its own, a set operation, a WITH).
Context for cume_dist_mutator.
| const constants_t* cume_dist_ctx::constants |
| Query* cume_dist_ctx::q |