G with a(a, b, c) as (select * from t1) select * from a as a1 inner join a as a2 on a1.a = a2.c; (before rewrites) cluster3 Box3:Select cluster4 Box4:Select cluster2 Box2:Select cluster0 Box0:Select cluster1 Box1:BaseTable T1 boxhead3 Distinct: Preserve 0: Q4.c0 as A 1: Q4.c1 as B 2: Q4.c2 as C 3: Q4.c3 as A 4: Q4.c4 as B 5: Q4.c5 as C Q4 Q4(F) boxhead4 Distinct: Preserve 0: Q2.c0 as A 1: Q2.c1 as B 2: Q2.c2 as C 3: Q3.c0 as A 4: Q3.c1 as B 5: Q3.c2 as C Q4->boxhead4 Q2 Q2(F) as A1 Q3 Q3(F) as A2 Q2->Q3 (Q2.c0) = (Q3.c2) boxhead2 Distinct: Preserve 0: Q1.c0 as A 1: Q1.c1 as B 2: Q1.c2 as C Q2->boxhead2 Q3->boxhead2 Q1 Q1(F) boxhead0 Distinct: Preserve 0: Q0.c0 as F1 1: Q0.c1 as F2 2: Q0.c2 as F3 Q1->boxhead0 Q0 Q0(F) as T1 boxhead1 Distinct: Preserve 0: c0 as F1 1: c1 as F2 2: c2 as F3 Q0->boxhead1