G select a from a group by a; (before rewrites) cluster3 Box3:Select cluster2 Box2:Grouping cluster0 Box0:Select cluster1 Box1:BaseTable A boxhead3 Distinct: Preserve 0: Q2.c0 as A UNIQUE KEY [0] Q2 Q2(F) boxhead2 Distinct: Preserve 0: Q1.c0 as A GROUP Q1.c0 Ascending UNIQUE KEY [0] Q2->boxhead2 Q1 Q1(F) boxhead0 Distinct: Preserve 0: Q0.c0 as A 1: Q0.c1 as B Q1->boxhead0 Q0 Q0(F) as A boxhead1 Distinct: Preserve 0: c0 as A 1: c1 as B Q0->boxhead1