|
658 | 658 | {
|
659 | 659 | "SQL": "EXPLAIN select o.o_id, count(*) from c, o where c.c_id=o.c_id group by o.o_id; -- 2. test agg push down, group by non-join column",
|
660 | 660 | "Plan": [
|
661 |
| - "TableReader_78 8000.00 root MppVersion: 1, data:ExchangeSender_77", |
662 |
| - "└─ExchangeSender_77 8000.00 mpp[tiflash] ExchangeType: PassThrough", |
| 661 | + "TableReader_84 8000.00 root MppVersion: 1, data:ExchangeSender_83", |
| 662 | + "└─ExchangeSender_83 8000.00 mpp[tiflash] ExchangeType: PassThrough", |
663 | 663 | " └─Projection_10 8000.00 mpp[tiflash] test.o.o_id, Column#6",
|
664 |
| - " └─Projection_76 8000.00 mpp[tiflash] Column#6, test.o.o_id", |
665 |
| - " └─HashAgg_75 8000.00 mpp[tiflash] group by:test.o.o_id, funcs:count(Column#7)->Column#6, funcs:firstrow(Column#8)->test.o.o_id", |
666 |
| - " └─ExchangeReceiver_71 9990.00 mpp[tiflash] ", |
667 |
| - " └─ExchangeSender_70 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.o_id, collate: binary]", |
668 |
| - " └─HashJoin_69 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]", |
669 |
| - " ├─ExchangeReceiver_34(Build) 8000.00 mpp[tiflash] ", |
670 |
| - " │ └─ExchangeSender_33 8000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", |
671 |
| - " │ └─Projection_29 8000.00 mpp[tiflash] Column#7, Column#8, test.o.o_id, test.o.c_id", |
672 |
| - " │ └─HashAgg_30 8000.00 mpp[tiflash] group by:test.o.c_id, test.o.o_id, funcs:sum(Column#9)->Column#7, funcs:firstrow(test.o.o_id)->Column#8, funcs:firstrow(test.o.o_id)->test.o.o_id, funcs:firstrow(test.o.c_id)->test.o.c_id", |
673 |
| - " │ └─ExchangeReceiver_32 8000.00 mpp[tiflash] ", |
674 |
| - " │ └─ExchangeSender_31 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.o_id, collate: binary], [name: test.o.c_id, collate: binary]", |
675 |
| - " │ └─HashAgg_21 8000.00 mpp[tiflash] group by:test.o.c_id, test.o.o_id, funcs:count(1)->Column#9", |
676 |
| - " │ └─TableFullScan_28 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo", |
677 |
| - " └─Selection_19(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))", |
678 |
| - " └─TableFullScan_18 10000.00 mpp[tiflash] table:c pushed down filter:empty, keep order:false, stats:pseudo" |
| 664 | + " └─Projection_79 8000.00 mpp[tiflash] Column#6, test.o.o_id", |
| 665 | + " └─HashAgg_80 8000.00 mpp[tiflash] group by:test.o.o_id, funcs:sum(Column#25)->Column#6, funcs:firstrow(Column#26)->test.o.o_id", |
| 666 | + " └─ExchangeReceiver_82 8000.00 mpp[tiflash] ", |
| 667 | + " └─ExchangeSender_81 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.o_id, collate: binary]", |
| 668 | + " └─HashAgg_76 8000.00 mpp[tiflash] group by:Column#29, funcs:sum(Column#27)->Column#25, funcs:firstrow(Column#28)->Column#26", |
| 669 | + " └─Projection_85 9990.00 mpp[tiflash] cast(Column#7, decimal(20,0) BINARY)->Column#27, Column#8, test.o.o_id", |
| 670 | + " └─HashJoin_78 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]", |
| 671 | + " ├─ExchangeReceiver_34(Build) 8000.00 mpp[tiflash] ", |
| 672 | + " │ └─ExchangeSender_33 8000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", |
| 673 | + " │ └─Projection_29 8000.00 mpp[tiflash] Column#7, Column#8, test.o.o_id, test.o.c_id", |
| 674 | + " │ └─HashAgg_30 8000.00 mpp[tiflash] group by:test.o.c_id, test.o.o_id, funcs:sum(Column#9)->Column#7, funcs:firstrow(test.o.o_id)->Column#8, funcs:firstrow(test.o.o_id)->test.o.o_id, funcs:firstrow(test.o.c_id)->test.o.c_id", |
| 675 | + " │ └─ExchangeReceiver_32 8000.00 mpp[tiflash] ", |
| 676 | + " │ └─ExchangeSender_31 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.o_id, collate: binary], [name: test.o.c_id, collate: binary]", |
| 677 | + " │ └─HashAgg_21 8000.00 mpp[tiflash] group by:test.o.c_id, test.o.o_id, funcs:count(1)->Column#9", |
| 678 | + " │ └─TableFullScan_28 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo", |
| 679 | + " └─Selection_19(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))", |
| 680 | + " └─TableFullScan_18 10000.00 mpp[tiflash] table:c pushed down filter:empty, keep order:false, stats:pseudo" |
679 | 681 | ],
|
680 | 682 | "Warn": null
|
681 | 683 | },
|
682 | 684 | {
|
683 | 685 | "SQL": "EXPLAIN select o.c_id, count(*) from c, o where c.c_id=o.c_id group by o.c_id; -- 3. test agg push down, group by join column",
|
684 | 686 | "Plan": [
|
685 |
| - "TableReader_78 8000.00 root MppVersion: 1, data:ExchangeSender_77", |
686 |
| - "└─ExchangeSender_77 8000.00 mpp[tiflash] ExchangeType: PassThrough", |
| 687 | + "TableReader_84 8000.00 root MppVersion: 1, data:ExchangeSender_83", |
| 688 | + "└─ExchangeSender_83 8000.00 mpp[tiflash] ExchangeType: PassThrough", |
687 | 689 | " └─Projection_10 8000.00 mpp[tiflash] test.o.c_id, Column#6",
|
688 |
| - " └─Projection_76 8000.00 mpp[tiflash] Column#6, test.o.c_id", |
689 |
| - " └─HashAgg_75 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:count(Column#7)->Column#6, funcs:firstrow(Column#8)->test.o.c_id", |
690 |
| - " └─ExchangeReceiver_71 9990.00 mpp[tiflash] ", |
691 |
| - " └─ExchangeSender_70 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.c_id, collate: binary]", |
692 |
| - " └─HashJoin_69 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]", |
693 |
| - " ├─ExchangeReceiver_34(Build) 8000.00 mpp[tiflash] ", |
694 |
| - " │ └─ExchangeSender_33 8000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", |
695 |
| - " │ └─Projection_29 8000.00 mpp[tiflash] Column#7, Column#8, test.o.c_id", |
696 |
| - " │ └─HashAgg_30 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:sum(Column#9)->Column#7, funcs:firstrow(test.o.c_id)->Column#8, funcs:firstrow(test.o.c_id)->test.o.c_id", |
697 |
| - " │ └─ExchangeReceiver_32 8000.00 mpp[tiflash] ", |
698 |
| - " │ └─ExchangeSender_31 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.c_id, collate: binary]", |
699 |
| - " │ └─HashAgg_21 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:count(1)->Column#9", |
700 |
| - " │ └─TableFullScan_28 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo", |
701 |
| - " └─Selection_19(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))", |
702 |
| - " └─TableFullScan_18 10000.00 mpp[tiflash] table:c pushed down filter:empty, keep order:false, stats:pseudo" |
| 690 | + " └─Projection_79 8000.00 mpp[tiflash] Column#6, test.o.c_id", |
| 691 | + " └─HashAgg_80 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:sum(Column#21)->Column#6, funcs:firstrow(Column#22)->test.o.c_id", |
| 692 | + " └─ExchangeReceiver_82 8000.00 mpp[tiflash] ", |
| 693 | + " └─ExchangeSender_81 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.c_id, collate: binary]", |
| 694 | + " └─HashAgg_76 8000.00 mpp[tiflash] group by:Column#25, funcs:sum(Column#23)->Column#21, funcs:firstrow(Column#24)->Column#22", |
| 695 | + " └─Projection_85 9990.00 mpp[tiflash] cast(Column#7, decimal(20,0) BINARY)->Column#23, Column#8, test.o.c_id", |
| 696 | + " └─HashJoin_78 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]", |
| 697 | + " ├─ExchangeReceiver_34(Build) 8000.00 mpp[tiflash] ", |
| 698 | + " │ └─ExchangeSender_33 8000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", |
| 699 | + " │ └─Projection_29 8000.00 mpp[tiflash] Column#7, Column#8, test.o.c_id", |
| 700 | + " │ └─HashAgg_30 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:sum(Column#9)->Column#7, funcs:firstrow(test.o.c_id)->Column#8, funcs:firstrow(test.o.c_id)->test.o.c_id", |
| 701 | + " │ └─ExchangeReceiver_32 8000.00 mpp[tiflash] ", |
| 702 | + " │ └─ExchangeSender_31 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.o.c_id, collate: binary]", |
| 703 | + " │ └─HashAgg_21 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:count(1)->Column#9", |
| 704 | + " │ └─TableFullScan_28 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo", |
| 705 | + " └─Selection_19(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))", |
| 706 | + " └─TableFullScan_18 10000.00 mpp[tiflash] table:c pushed down filter:empty, keep order:false, stats:pseudo" |
| 707 | + ], |
| 708 | + "Warn": null |
| 709 | + }, |
| 710 | + { |
| 711 | + "SQL": "EXPLAIN format='brief' select a, count(*) from (select a, b from t union all select a, b from t) t group by a order by a limit 10", |
| 712 | + "Plan": [ |
| 713 | + "Projection 10.00 root Column#7, Column#9", |
| 714 | + "└─TopN 10.00 root Column#7, offset:0, count:10", |
| 715 | + " └─TableReader 10.00 root MppVersion: 1, data:ExchangeSender", |
| 716 | + " └─ExchangeSender 10.00 mpp[tiflash] ExchangeType: PassThrough", |
| 717 | + " └─TopN 10.00 mpp[tiflash] Column#7, offset:0, count:10", |
| 718 | + " └─Projection 16000.00 mpp[tiflash] Column#9, Column#7", |
| 719 | + " └─HashAgg 16000.00 mpp[tiflash] group by:Column#40, funcs:sum(Column#38)->Column#9, funcs:firstrow(Column#39)->Column#7", |
| 720 | + " └─Projection 16000.00 mpp[tiflash] cast(Column#10, decimal(20,0) BINARY)->Column#38, Column#11, Column#7", |
| 721 | + " └─ExchangeReceiver 16000.00 mpp[tiflash] ", |
| 722 | + " └─ExchangeSender 16000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#7, collate: binary]", |
| 723 | + " └─Union 16000.00 mpp[tiflash] ", |
| 724 | + " ├─HashAgg 8000.00 mpp[tiflash] group by:test.t.a, funcs:sum(Column#30)->Column#10, funcs:firstrow(test.t.a)->Column#11, funcs:firstrow(test.t.a)->Column#7", |
| 725 | + " │ └─ExchangeReceiver 8000.00 mpp[tiflash] ", |
| 726 | + " │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary]", |
| 727 | + " │ └─HashAgg 8000.00 mpp[tiflash] group by:test.t.a, funcs:count(1)->Column#30", |
| 728 | + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo", |
| 729 | + " └─HashAgg 8000.00 mpp[tiflash] group by:test.t.a, funcs:sum(Column#33)->Column#10, funcs:firstrow(test.t.a)->Column#11, funcs:firstrow(test.t.a)->Column#7", |
| 730 | + " └─ExchangeReceiver 8000.00 mpp[tiflash] ", |
| 731 | + " └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary]", |
| 732 | + " └─HashAgg 8000.00 mpp[tiflash] group by:test.t.a, funcs:count(1)->Column#33", |
| 733 | + " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" |
703 | 734 | ],
|
704 | 735 | "Warn": null
|
705 | 736 | }
|
|
0 commit comments