make grouping paths work again, without XL optimizations
authorTomas Vondra <[email protected]>
Fri, 13 Jan 2017 23:37:07 +0000 (00:37 +0100)
committerTomas Vondra <[email protected]>
Fri, 13 Jan 2017 23:37:07 +0000 (00:37 +0100)
commit349335e24038a28ed893e5200e1aec86ab8a4fe4
treeba135c01e264a03fcdb111b3b0998b98cd6d585d
parent3a3fe8d23ea32a7860c39dc03c84c7133bcca2dd
make grouping paths work again, without XL optimizations

Commit d31927431b26af0c14f7a2abe6f2ee0af33f7b61 resolved some of the
conflicts in planner.c, caused by the pathification, by removing some
of the XL code. While this made the code compilable, it effectively
broken the aggregation on XL. This patch makes grouping paths work
again, in the sense that the generated paths should be correct and
return correct results.

The planner however does not generate advanced XL paths yet, in
particular it does not paths with 2-phase distributed aggregates
like this one:

    Aggregate (2nd phase: combine and finalize)
        -> Remote Subquery
            -> Aggregate (1st phase: partial)

Thanks to the parallel aggregate, implemented in 9.6, the planner
however can generate queries like this:

    Aggregate (2nd phase: combine and finalize)
        -> Remote Subquery
            -> Gather
                -> Aggregate (1st phase: partial)
src/backend/optimizer/plan/planner.c