-
Notifications
You must be signed in to change notification settings - Fork 5.7k
/
enforce_mpp_suite_out.json
713 lines (713 loc) · 38.4 KB
/
enforce_mpp_suite_out.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
[
{
"Name": "TestEnforceMPP",
"Cases": [
{
"SQL": "select @@tidb_allow_mpp",
"Plan": [
"1"
],
"Warn": null
},
{
"SQL": "select @@tidb_enforce_mpp",
"Plan": [
"0"
],
"Warn": null
},
{
"SQL": "select @@tidb_opt_tiflash_concurrency_factor",
"Plan": [
"24"
],
"Warn": null
},
{
"SQL": "set @@tidb_allow_mpp=0",
"Plan": null,
"Warn": null
},
{
"SQL": "explain format='verbose' select count(*) from t where a=1",
"Plan": [
"StreamAgg_24 1.00 35.88 root funcs:count(Column#6)->Column#4",
"└─IndexReader_25 1.00 32.88 root index:StreamAgg_9",
" └─StreamAgg_9 1.00 465.00 cop[tikv] funcs:count(1)->Column#6",
" └─IndexRangeScan_23 10.00 435.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1",
"Plan": [
"StreamAgg_17 1.00 35.88 root funcs:count(Column#6)->Column#4",
"└─IndexReader_18 1.00 32.88 root index:StreamAgg_9",
" └─StreamAgg_9 1.00 465.00 cop[tikv] funcs:count(1)->Column#6",
" └─IndexRangeScan_16 10.00 435.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1",
"Plan": [
"StreamAgg_20 1.00 19006.88 root funcs:count(Column#6)->Column#4",
"└─TableReader_21 1.00 19003.88 root data:StreamAgg_9",
" └─StreamAgg_9 1.00 285030.00 batchCop[tiflash] funcs:count(1)->Column#6",
" └─Selection_19 10.00 285000.00 batchCop[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_18 10000.00 255000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "set @@tidb_allow_mpp=1;",
"Plan": null,
"Warn": null
},
{
"SQL": "set @@tidb_enforce_mpp=0;",
"Plan": null,
"Warn": null
},
{
"SQL": "explain format='verbose' select count(*) from t where a=1",
"Plan": [
"StreamAgg_30 1.00 35.88 root funcs:count(Column#7)->Column#4",
"└─IndexReader_31 1.00 32.88 root index:StreamAgg_10",
" └─StreamAgg_10 1.00 465.00 cop[tikv] funcs:count(1)->Column#7",
" └─IndexRangeScan_29 10.00 435.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1",
"Plan": [
"StreamAgg_18 1.00 35.88 root funcs:count(Column#6)->Column#4",
"└─IndexReader_19 1.00 32.88 root index:StreamAgg_10",
" └─StreamAgg_10 1.00 465.00 cop[tikv] funcs:count(1)->Column#6",
" └─IndexRangeScan_17 10.00 435.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1",
"Plan": [
"HashAgg_21 1.00 11910.73 root funcs:count(Column#6)->Column#4",
"└─TableReader_23 1.00 11877.13 root data:ExchangeSender_22",
" └─ExchangeSender_22 1.00 285030.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashAgg_9 1.00 285030.00 mpp[tiflash] funcs:count(1)->Column#6",
" └─Selection_20 10.00 285000.00 mpp[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_19 10000.00 255000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "set @@tidb_opt_tiflash_concurrency_factor = 1000000",
"Plan": null,
"Warn": null
},
{
"SQL": "explain format='verbose' select count(*) from t where a=1",
"Plan": [
"HashAgg_24 1.00 33.89 root funcs:count(Column#6)->Column#4",
"└─TableReader_26 1.00 0.29 root data:ExchangeSender_25",
" └─ExchangeSender_25 1.00 285030.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashAgg_9 1.00 285030.00 mpp[tiflash] funcs:count(1)->Column#6",
" └─Selection_23 10.00 285000.00 mpp[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_22 10000.00 255000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1",
"Plan": [
"StreamAgg_18 1.00 35.88 root funcs:count(Column#6)->Column#4",
"└─IndexReader_19 1.00 32.88 root index:StreamAgg_10",
" └─StreamAgg_10 1.00 465.00 cop[tikv] funcs:count(1)->Column#6",
" └─IndexRangeScan_17 10.00 435.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1",
"Plan": [
"HashAgg_21 1.00 33.89 root funcs:count(Column#6)->Column#4",
"└─TableReader_23 1.00 0.29 root data:ExchangeSender_22",
" └─ExchangeSender_22 1.00 285030.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashAgg_9 1.00 285030.00 mpp[tiflash] funcs:count(1)->Column#6",
" └─Selection_20 10.00 285000.00 mpp[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_19 10000.00 255000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "set @@tidb_enforce_mpp=1;",
"Plan": null,
"Warn": null
},
{
"SQL": "explain format='verbose' select count(*) from t where a=1",
"Plan": [
"HashAgg_25 1.00 33.60 root funcs:count(Column#6)->Column#4",
"└─TableReader_27 1.00 0.00 root data:ExchangeSender_26",
" └─ExchangeSender_26 1.00 285030.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashAgg_10 1.00 285030.00 mpp[tiflash] funcs:count(1)->Column#6",
" └─Selection_24 10.00 285000.00 mpp[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_23 10000.00 255000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1",
"Plan": [
"StreamAgg_19 1.00 35.88 root funcs:count(Column#6)->Column#4",
"└─IndexReader_20 1.00 32.88 root index:StreamAgg_11",
" └─StreamAgg_11 1.00 465.00 cop[tikv] funcs:count(1)->Column#6",
" └─IndexRangeScan_18 10.00 435.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because you have set a hint to read table `t` from TiKV."
]
},
{
"SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1",
"Plan": [
"HashAgg_22 1.00 33.60 root funcs:count(Column#6)->Column#4",
"└─TableReader_24 1.00 0.00 root data:ExchangeSender_23",
" └─ExchangeSender_23 1.00 285030.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashAgg_10 1.00 285030.00 mpp[tiflash] funcs:count(1)->Column#6",
" └─Selection_21 10.00 285000.00 mpp[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_20 10000.00 255000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
}
]
},
{
"Name": "TestEnforceMPPWarning1",
"Cases": [
{
"SQL": "set @@tidb_allow_mpp=1;set @@tidb_enforce_mpp=1;",
"Plan": null,
"Warn": null
},
{
"SQL": "explain format = 'brief' select count(*) from t where a=1 -- 1. no replica",
"Plan": [
"StreamAgg 1.00 root funcs:count(Column#8)->Column#6",
"└─IndexReader 1.00 root index:StreamAgg",
" └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#8",
" └─IndexRangeScan 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because there aren't tiflash replicas of table `t`."
]
},
{
"SQL": "cmd: create-replica",
"Plan": null,
"Warn": null
},
{
"SQL": "explain select count(*) from t where a=1 -- 2. replica not ready",
"Plan": [
"StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6",
"└─IndexReader_18 1.00 root index:StreamAgg_9",
" └─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8",
" └─IndexRangeScan_16 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because tiflash replicas of table `t` not ready."
]
},
{
"SQL": "cmd: enable-replica",
"Plan": null,
"Warn": null
},
{
"SQL": "set @@session.tidb_isolation_read_engines = 'tikv';",
"Plan": null,
"Warn": null
},
{
"SQL": "explain select count(*) from t where a=1 -- 3. isolation_engine not match",
"Plan": [
"StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6",
"└─IndexReader_18 1.00 root index:StreamAgg_9",
" └─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8",
" └─IndexRangeScan_16 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because 'tidb_isolation_read_engines'(value: 'tikv') not match, need 'tiflash'."
]
},
{
"SQL": "set @@session.tidb_isolation_read_engines = 'tikv, tiflash';",
"Plan": null,
"Warn": null
},
{
"SQL": "explain format = 'brief' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1 -- 4. hint use tikv",
"Plan": [
"StreamAgg 1.00 root funcs:count(Column#8)->Column#6",
"└─IndexReader 1.00 root index:StreamAgg",
" └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#8",
" └─IndexRangeScan 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because you have set a hint to read table `t` from TiKV."
]
},
{
"SQL": "explain format = 'brief' SELECT a, ROW_NUMBER() OVER (ORDER BY a) FROM t; -- 5. window unsupported",
"Plan": [
"TableReader 10000.00 root data:ExchangeSender",
"└─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─Window 10000.00 mpp[tiflash] row_number()->Column#7 over(order by test.t.a rows between current row and current row)",
" └─Sort 10000.00 mpp[tiflash] test.t.a",
" └─ExchangeReceiver 10000.00 mpp[tiflash] ",
" └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "EXPLAIN format = 'brief' SELECT t1.b FROM t t1 join t t2 where t1.a=t2.a; -- 6. virtual column",
"Plan": [
"HashJoin 12487.50 root inner join, equal:[eq(test.t.a, test.t.a)]",
"├─TableReader(Build) 9990.00 root data:Selection",
"│ └─Selection 9990.00 cop[tiflash] not(isnull(test.t.a))",
"│ └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo",
"└─TableReader(Probe) 9990.00 root data:Selection",
" └─Selection 9990.00 cop[tiflash] not(isnull(test.t.a))",
" └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because column `test.t.b` is a virtual column which is not supported now."
]
},
{
"SQL": "EXPLAIN format = 'brief' SELECT count(b) from t where a=1; -- 7. agg func has virtual column",
"Plan": [
"StreamAgg 1.00 root funcs:count(test.t.b)->Column#6",
"└─IndexLookUp 10.00 root ",
" ├─IndexRangeScan(Build) 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo",
" └─TableRowIDScan(Probe) 10.00 cop[tikv] table:t keep order:false, stats:pseudo"
],
"Warn": [
"Aggregation can not be pushed to tiflash because expressions of AggFunc `count` contain virtual column or correlated column, which is not supported now",
"Aggregation can not be pushed to tiflash because expressions of AggFunc `count` contain virtual column or correlated column, which is not supported now",
"Aggregation can not be pushed to tikv because expressions of AggFunc `count` contain virtual column or correlated column, which is not supported now",
"Aggregation can not be pushed to tiflash because expressions of AggFunc `count` contain virtual column or correlated column, which is not supported now",
"Aggregation can not be pushed to tiflash because expressions of AggFunc `count` contain virtual column or correlated column, which is not supported now"
]
},
{
"SQL": "EXPLAIN format = 'brief' SELECT count(*) from t group by b; -- 8. group by virtual column",
"Plan": [
"HashAgg 8000.00 root group by:test.t.b, funcs:count(1)->Column#6",
"└─Projection 10000.00 root test.t.b",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"Aggregation can not be pushed to tiflash because groupByItems contain virtual columns, which is not supported now",
"Aggregation can not be pushed to tiflash because groupByItems contain virtual columns, which is not supported now",
"Aggregation can not be pushed to tiflash because groupByItems contain virtual columns, which is not supported now"
]
},
{
"SQL": "EXPLAIN format = 'brief' SELECT count(a) from t group by md5(a); -- 10. scalar func not supported",
"Plan": [
"HashAgg 8000.00 root group by:Column#8, funcs:count(Column#7)->Column#6",
"└─Projection 10000.00 root test.t.a, md5(cast(test.t.a, var_string(20)))->Column#8",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.",
"Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs",
"Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.",
"Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs",
"Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.",
"Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs"
]
},
{
"SQL": "EXPLAIN format = 'brief' SELECT count(a) from t where c=1; -- 11. type not supported",
"Plan": [
"StreamAgg 1.00 root funcs:count(test.t.a)->Column#6",
"└─Selection 10.00 root eq(test.t.c, 1)",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"Expression about 'test.t.c' can not be pushed to TiFlash because it contains unsupported calculation of type 'enum'.",
"Expression about 'test.t.c' can not be pushed to TiFlash because it contains unsupported calculation of type 'enum'.",
"Expression about 'test.t.c' can not be pushed to TiFlash because it contains unsupported calculation of type 'enum'.",
"Expression about 'test.t.c' can not be pushed to TiFlash because it contains unsupported calculation of type 'enum'.",
"Expression about 'test.t.c' can not be pushed to TiFlash because it contains unsupported calculation of type 'enum'."
]
},
{
"SQL": "EXPLAIN format = 'brief' SELECT count(a) from t where d=1; -- 11.1. type not supported",
"Plan": [
"StreamAgg 1.00 root funcs:count(test.t.a)->Column#6",
"└─Selection 10.00 root eq(test.t.d, 1)",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"Expression about 'test.t.d' can not be pushed to TiFlash because it contains unsupported calculation of type 'bit'.",
"Expression about 'test.t.d' can not be pushed to TiFlash because it contains unsupported calculation of type 'bit'.",
"Expression about 'test.t.d' can not be pushed to TiFlash because it contains unsupported calculation of type 'bit'.",
"Expression about 'test.t.d' can not be pushed to TiFlash because it contains unsupported calculation of type 'bit'.",
"Expression about 'test.t.d' can not be pushed to TiFlash because it contains unsupported calculation of type 'bit'."
]
}
]
},
{
"Name": "TestEnforceMPPWarning2",
"Cases": [
{
"SQL": "set @@tidb_allow_mpp=1;set @@tidb_enforce_mpp=1;",
"Plan": null,
"Warn": null
},
{
"SQL": "set @@tidb_partition_prune_mode=static;",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT count(*) from t where a=1; -- 1. static partition prune",
"Plan": [
"StreamAgg_32 1.00 root funcs:count(Column#6)->Column#4",
"└─TableReader_33 1.00 root data:StreamAgg_13",
" └─StreamAgg_13 1.00 batchCop[tiflash] funcs:count(1)->Column#6",
" └─Selection_31 10.00 batchCop[tiflash] eq(test.t.a, 1)",
" └─TableFullScan_30 10000.00 batchCop[tiflash] table:t, partition:p0 keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because table `t`is a partition table which is not supported when `@@tidb_partition_prune_mode=static`."
]
},
{
"SQL": "set @@tidb_partition_prune_mode=dynamic;",
"Plan": null,
"Warn": null
}
]
},
{
"Name": "TestEnforceMPPWarning3",
"Cases": [
{
"SQL": "set @@tidb_allow_mpp=1;set @@tidb_enforce_mpp=1;set @@tidb_hash_exchange_with_new_collation=0;",
"Plan": null,
"Warn": null
},
{
"SQL": "cmd: enable-new-collation",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT count(*) from t group by b; -- 1. new collation FIXME",
"Plan": [
"HashAgg_24 8000.00 root group by:test.t.b, funcs:count(Column#7)->Column#4",
"└─TableReader_26 8000.00 root data:ExchangeSender_25",
" └─ExchangeSender_25 8000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashAgg_11 8000.00 mpp[tiflash] group by:test.t.b, funcs:count(1)->Column#7",
" └─TableFullScan_21 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because when `new_collation_enabled` is true, HashJoin or HashAgg with string key is not supported now.",
"MPP mode may be blocked because when `new_collation_enabled` is true, HashJoin or HashAgg with string key is not supported now.",
"MPP mode may be blocked because when `new_collation_enabled` is true, HashJoin or HashAgg with string key is not supported now."
]
},
{
"SQL": "EXPLAIN SELECT * from t t1 join t t2 on t1.b=t2.b; -- 2. new collation FIXME",
"Plan": [
"TableReader_34 12487.50 root data:ExchangeSender_33",
"└─ExchangeSender_33 12487.50 mpp[tiflash] ExchangeType: PassThrough",
" └─HashJoin_32 12487.50 mpp[tiflash] inner join, equal:[eq(test.t.b, test.t.b)]",
" ├─ExchangeReceiver_15(Build) 9990.00 mpp[tiflash] ",
" │ └─ExchangeSender_14 9990.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─Selection_13 9990.00 mpp[tiflash] not(isnull(test.t.b))",
" │ └─TableFullScan_12 10000.00 mpp[tiflash] table:t1 keep order:false, stats:pseudo",
" └─Selection_17(Probe) 9990.00 mpp[tiflash] not(isnull(test.t.b))",
" └─TableFullScan_16 10000.00 mpp[tiflash] table:t2 keep order:false, stats:pseudo"
],
"Warn": null
}
]
},
{
"Name": "TestEnforceMPPWarning4",
"Cases": [
{
"SQL": "set @@tidb_allow_mpp=1;set @@tidb_enforce_mpp=1; -- test joins",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT /*+ MERGE_JOIN(t,s) */ * from t join s using(a); -- 1. hint use MERGE_JOIN",
"Plan": [
"MergeJoin_8 12500.00 root inner join, left key:test.t.a, right key:test.s.a",
"├─TableReader_18(Build) 10000.00 root data:TableFullScan_17",
"│ └─TableFullScan_17 10000.00 cop[tiflash] table:s keep order:true, stats:pseudo",
"└─TableReader_14(Probe) 10000.00 root data:TableFullScan_13",
" └─TableFullScan_13 10000.00 cop[tiflash] table:t keep order:true, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now.",
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now."
]
},
{
"SQL": "EXPLAIN SELECT /*+ INL_JOIN(t,s) */ * from t, s where t.a=s.a; -- 2. hint use INL_JOIN",
"Plan": [
"IndexJoin_15 12500.00 root inner join, inner:TableReader_12, outer key:test.t.a, inner key:test.s.a, equal cond:eq(test.t.a, test.s.a)",
"├─TableReader_32(Build) 10000.00 root data:TableFullScan_31",
"│ └─TableFullScan_31 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo",
"└─TableReader_12(Probe) 1.00 root data:TableRangeScan_11",
" └─TableRangeScan_11 1.00 cop[tikv] table:s range: decided by [test.t.a], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now.",
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now."
]
},
{
"SQL": "EXPLAIN SELECT /*+ INL_HASH_JOIN(t,s) */ * from t join s using(a); -- 3. hint use INL_HASH_JOIN",
"Plan": [
"IndexHashJoin_16 12500.00 root inner join, inner:TableReader_11, outer key:test.t.a, inner key:test.s.a, equal cond:eq(test.t.a, test.s.a)",
"├─TableReader_31(Build) 10000.00 root data:TableFullScan_30",
"│ └─TableFullScan_30 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo",
"└─TableReader_11(Probe) 1.00 root data:TableRangeScan_10",
" └─TableRangeScan_10 1.00 cop[tikv] table:s range: decided by [test.t.a], keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now.",
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now."
]
},
{
"SQL": "EXPLAIN SELECT /*+ HASH_JOIN(t,s) */ * from t join s using(a); -- 4. hint use INL_JOIN",
"Plan": [
"HashJoin_28 12500.00 root inner join, equal:[eq(test.t.a, test.s.a)]",
"├─TableReader_37(Build) 10000.00 root data:TableFullScan_36",
"│ └─TableFullScan_36 10000.00 cop[tiflash] table:s keep order:false, stats:pseudo",
"└─TableReader_33(Probe) 10000.00 root data:TableFullScan_32",
" └─TableFullScan_32 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now.",
"MPP mode may be blocked because you have used hint to specify a join algorithm which is not supported by mpp now."
]
},
{
"SQL": "set @@tidb_opt_broadcast_cartesian_join = 0",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT * from t join s; -- 5. cartesian join, cartesian banned.",
"Plan": [
"HashJoin_8 100000000.00 root CARTESIAN inner join",
"├─TableReader_17(Build) 10000.00 root data:TableFullScan_16",
"│ └─TableFullScan_16 10000.00 cop[tiflash] table:s keep order:false, stats:pseudo",
"└─TableReader_13(Probe) 10000.00 root data:TableFullScan_12",
" └─TableFullScan_12 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because `Cartesian Product` is only supported by broadcast join, check value and documents of variable `tidb_opt_broadcast_cartesian_join`.",
"MPP mode may be blocked because `Cartesian Product` is only supported by broadcast join, check value and documents of variable `tidb_opt_broadcast_cartesian_join`."
]
},
{
"SQL": "set @@tidb_broadcast_join_threshold_size = 0; set @@tidb_opt_broadcast_cartesian_join = 1",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT * from t join s; -- 6. cartesian join, broadcast banned.",
"Plan": [
"HashJoin_8 100000000.00 root CARTESIAN inner join",
"├─TableReader_17(Build) 10000.00 root data:TableFullScan_16",
"│ └─TableFullScan_16 10000.00 cop[tiflash] table:s keep order:false, stats:pseudo",
"└─TableReader_13(Probe) 10000.00 root data:TableFullScan_12",
" └─TableFullScan_12 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because `Cartesian Product` is only supported by broadcast join, check value and documents of variables `tidb_broadcast_join_threshold_size` and `tidb_broadcast_join_threshold_count`.",
"MPP mode may be blocked because `Cartesian Product` is only supported by broadcast join, check value and documents of variables `tidb_broadcast_join_threshold_size` and `tidb_broadcast_join_threshold_count`."
]
},
{
"SQL": "set @@tidb_broadcast_join_threshold_size = 104857600; set @@tidb_opt_broadcast_cartesian_join = 1",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT * from t join s; -- can use mpp",
"Plan": [
"TableReader_27 100000000.00 root data:ExchangeSender_26",
"└─ExchangeSender_26 100000000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashJoin_25 100000000.00 mpp[tiflash] CARTESIAN inner join",
" ├─ExchangeReceiver_13(Build) 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_12 10000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─TableFullScan_11 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo",
" └─TableFullScan_14(Probe) 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "set @@tidb_broadcast_join_threshold_size = 0; set @@tidb_opt_broadcast_cartesian_join = 2",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN SELECT * from t join s; -- can use mpp",
"Plan": [
"TableReader_27 100000000.00 root data:ExchangeSender_26",
"└─ExchangeSender_26 100000000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashJoin_25 100000000.00 mpp[tiflash] CARTESIAN inner join",
" ├─ExchangeReceiver_13(Build) 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_12 10000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─TableFullScan_11 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo",
" └─TableFullScan_14(Probe) 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "set @@tidb_broadcast_join_threshold_size = 104857600; set @@tidb_opt_broadcast_cartesian_join = 1;",
"Plan": null,
"Warn": null
},
{
"SQL": "explain select a from t where t.a>1 or t.a in (select a from t); -- 7. left outer semi join",
"Plan": [
"TableReader_48 8000.00 root data:ExchangeSender_47",
"└─ExchangeSender_47 8000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─Projection_8 8000.00 mpp[tiflash] test.t.a",
" └─Selection_45 8000.00 mpp[tiflash] or(gt(test.t.a, 1), Column#3)",
" └─HashJoin_46 10000.00 mpp[tiflash] left outer semi join, equal:[eq(test.t.a, test.t.a)]",
" ├─ExchangeReceiver_26(Build) 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_25 10000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─TableFullScan_24 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo",
" └─TableFullScan_23(Probe) 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain select a from t where t.a>1 or t.a not in (select a from t); -- now it's supported -- 8. anti left outer semi join",
"Plan": [
"TableReader_48 8000.00 root data:ExchangeSender_47",
"└─ExchangeSender_47 8000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─Projection_8 8000.00 mpp[tiflash] test.t.a",
" └─Selection_45 8000.00 mpp[tiflash] or(gt(test.t.a, 1), Column#3)",
" └─HashJoin_46 10000.00 mpp[tiflash] anti left outer semi join, equal:[eq(test.t.a, test.t.a)]",
" ├─ExchangeReceiver_26(Build) 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_25 10000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─TableFullScan_24 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo",
" └─TableFullScan_23(Probe) 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "explain select a from t where t.a not in (select a from s where t.a<1); -- 9. non left join has left conditions",
"Plan": [
"MergeJoin_10 8000.00 root anti semi join, left key:test.t.a, right key:test.s.a, left cond:[lt(test.t.a, 1)]",
"├─TableReader_29(Build) 10000.00 root data:TableFullScan_28",
"│ └─TableFullScan_28 10000.00 cop[tiflash] table:s keep order:true, stats:pseudo",
"└─TableReader_25(Probe) 10000.00 root data:TableFullScan_24",
" └─TableFullScan_24 10000.00 cop[tiflash] table:t keep order:true, stats:pseudo"
],
"Warn": [
"MPP mode may be blocked because there is a join that is not `left join` but has left conditions, which is not supported by mpp now, see github.com/pingcap/tidb/issues/26090 for more information.",
"MPP mode may be blocked because there is a join that is not `left join` but has left conditions, which is not supported by mpp now, see github.com/pingcap/tidb/issues/26090 for more information."
]
}
]
},
{
"Name": "TestMPP2PhaseAggPushDown",
"Cases": [
{
"SQL": "set @@tidb_allow_mpp=1;set @@tidb_enforce_mpp=1;set @@tidb_opt_agg_push_down=1;",
"Plan": null,
"Warn": null
},
{
"SQL": "EXPLAIN select count(*) from c, o where c.c_id=o.c_id; -- 1. test agg push down, scalar aggregate",
"Plan": [
"HashAgg_13 1.00 root funcs:count(Column#7)->Column#6",
"└─TableReader_35 9990.00 root data:ExchangeSender_34",
" └─ExchangeSender_34 9990.00 mpp[tiflash] ExchangeType: PassThrough",
" └─HashJoin_14 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]",
" ├─ExchangeReceiver_26(Build) 8000.00 mpp[tiflash] ",
" │ └─ExchangeSender_25 8000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─Projection_24 8000.00 mpp[tiflash] Column#7, test.o.c_id",
" │ └─HashAgg_19 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:count(1)->Column#7, funcs:firstrow(test.o.c_id)->test.o.c_id",
" │ └─ExchangeReceiver_23 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_22 10000.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.o.c_id, collate: binary]",
" │ └─TableFullScan_21 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo",
" └─Selection_18(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))",
" └─TableFullScan_17 10000.00 mpp[tiflash] table:c keep order:false, stats:pseudo"
],
"Warn": null
},
{
"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",
"Plan": [
"TableReader_78 8000.00 root data:ExchangeSender_77",
"└─ExchangeSender_77 8000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─Projection_10 8000.00 mpp[tiflash] test.o.o_id, Column#6",
" └─Projection_76 8000.00 mpp[tiflash] Column#6, test.o.o_id",
" └─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",
" └─ExchangeReceiver_71 9990.00 mpp[tiflash] ",
" └─ExchangeSender_70 9990.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.o.o_id, collate: binary]",
" └─HashJoin_69 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]",
" ├─ExchangeReceiver_27(Build) 8000.00 mpp[tiflash] ",
" │ └─ExchangeSender_26 8000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─Projection_25 8000.00 mpp[tiflash] Column#7, Column#8, test.o.o_id, test.o.c_id",
" │ └─HashAgg_20 8000.00 mpp[tiflash] group by:test.o.c_id, test.o.o_id, funcs:count(1)->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",
" │ └─ExchangeReceiver_24 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_23 10000.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.o.o_id, collate: binary], [name: test.o.c_id, collate: binary]",
" │ └─TableFullScan_22 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo",
" └─Selection_19(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))",
" └─TableFullScan_18 10000.00 mpp[tiflash] table:c keep order:false, stats:pseudo"
],
"Warn": null
},
{
"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",
"Plan": [
"TableReader_78 8000.00 root data:ExchangeSender_77",
"└─ExchangeSender_77 8000.00 mpp[tiflash] ExchangeType: PassThrough",
" └─Projection_10 8000.00 mpp[tiflash] test.o.c_id, Column#6",
" └─Projection_76 8000.00 mpp[tiflash] Column#6, test.o.c_id",
" └─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",
" └─ExchangeReceiver_71 9990.00 mpp[tiflash] ",
" └─ExchangeSender_70 9990.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.o.c_id, collate: binary]",
" └─HashJoin_69 9990.00 mpp[tiflash] inner join, equal:[eq(test.c.c_id, test.o.c_id)]",
" ├─ExchangeReceiver_27(Build) 8000.00 mpp[tiflash] ",
" │ └─ExchangeSender_26 8000.00 mpp[tiflash] ExchangeType: Broadcast",
" │ └─Projection_25 8000.00 mpp[tiflash] Column#7, Column#8, test.o.c_id",
" │ └─HashAgg_20 8000.00 mpp[tiflash] group by:test.o.c_id, funcs:count(1)->Column#7, funcs:firstrow(test.o.c_id)->Column#8, funcs:firstrow(test.o.c_id)->test.o.c_id",
" │ └─ExchangeReceiver_24 10000.00 mpp[tiflash] ",
" │ └─ExchangeSender_23 10000.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.o.c_id, collate: binary]",
" │ └─TableFullScan_22 10000.00 mpp[tiflash] table:o keep order:false, stats:pseudo",
" └─Selection_19(Probe) 9990.00 mpp[tiflash] not(isnull(test.c.c_id))",
" └─TableFullScan_18 10000.00 mpp[tiflash] table:c keep order:false, stats:pseudo"
],
"Warn": null
}
]
}
]