Open guo-shaoge opened 3 months ago
The current tidb cannot detect if the self-joining target table is already in p (already built sub-plan), then eliminate the current join and leave basic p to produce one more thing. In this case, we can ask for internal llineitem
to generate HashAgg_49
for us, rather than do another join to get it. Acked.
Enhancement
TiDB plan: two hash_join, two hash_agg.
But actually only one hash_join and only one hash_agg is enough. (check starrocks plan)