使用建议:
Index Join Porbe 端的并行是 Batch Size 为单位的并行,Probe Wokers 每次消费一个 Batch Size 的回表任务来加速 Probe 过程。每当一个并行任务的驱动 task 数量 < concurrency 时,说明没有充分利用 Probe 并发,应该适当调小当驱动表的 Batch Size,增加 task 数量,以便为了更高效地触发 Probe 的并行。
tidb> explain analyze select * from t1, t2
where t1.a = t2.a and t1.a=1;
+------------------------------+----------+------------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+------------------------------+----------+------------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
| HashJoin_8 | 9663.68 | 1073741824 | root | | time:22.7s, loops:1048577, RU:38.960331, build_hash_table:{total:29.3ms, fetch:28ms, build:1.31ms}, probe:{concurrency:5, total:1m51.7s, max:22.8s, probe:1m47.3s, fetch and
wait:4.41s} | CARTESIAN inner join | 1.14 MB | 0 Bytes |
| ├─TableReader_15(Build) | 98.30 | 32768 | root | | time:28.3ms, loops:33, cop_task: {num: 8, max: 12.7ms, min: 304.4µs, avg: 3.57ms, p95: 12.7ms, tot_proc: 25ms, copr_cache_hit_ratio: 0.00, build_task_duration: 3µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:8, total_time:28.5ms}} | data:Selection_14 | 399.7 KB | N/A |
| │ └─Selection_14 | 98.30 | 32768 | cop[tikv] | | tikv_task:{proc max:12.7ms, min:280.2µs, avg: 3.52ms, p80:7.09ms, p95:12.7ms, iters:0, tasks:8}, time_detail: {total_process_time: 25ms} | eq(1, test.t2.a) | N/A | N/A |
| │ └─TableFullScan_13 | 98304.00 | 98304 | cop[tikv] | table:t2 | tikv_task:{proc max:12.7ms, min:280.2µs, avg: 3.52ms, p80:7.09ms, p95:12.7ms, iters:0, tasks:8} | keep order:
false, stats:pseudo | N/A | N/A |
| └─TableReader_12(Probe) | 98.30 | 32768 | root | | time:6.3ms, loops:33, cop_task: {num: 8, max: 8.93ms, min: 329.4µs, avg: 2.89ms, p95: 8.93ms, tot_proc: 19ms, copr_cache_hit_ratio: 0.00, build_task_duration: 22.1µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:8, total_time:23ms}} | data:Selection_11 | 399.7 KB | N/A |
| └─Selection_11 | 98.30 | 32768 | cop[tikv] | | tikv_task:{proc max:8.83ms, min:304.7µs, avg: 2.83ms, p80:6.28ms, p95:8.83ms, iters:0, tasks:8}, time_detail: {total_process_time: 19ms} | eq(test.t1.a, 1) | N/A | N/A |
| └─TableFullScan_10 | 98304.00 | 98304 | cop[tikv] | table:t1 | tikv_task:{proc max:8.83ms, min:304.7µs, avg: 2.83ms, p80:6.28ms, p95:8.83ms, iters:0, tasks:8} | keep order:
false, stats:pseudo | N/A | N/A |
+------------------------------+----------+------------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
7 rows
in
set (22.83 sec)
mysql> explain analyze select * from t1,t2
where t1.a=t2.a;
+--------------------------------+----------+-----------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+----------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+--------------------------------+----------+-----------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+----------+---------+
| Projection_9 | 12487.50 | 440401920 | root | | time:7.9s, loops:430081, RU:30.108091, Concurrency:5 | test.t1.a, test.t1.b, test.t2.a, test.t2.b | 379.7 KB | N/A |
| └─HashJoin_25 | 12487.50 | 440401920 | root | | time:7.71s, loops:430081, build_hash_table:{total:4.84ms, fetch:3.62ms, build:1.22ms}, probe:{concurrency:5, total:38.5s, max:7.95s, probe:37s, fetch and
wait:1.55s} | inner join, equal:[eq(test.t2.a, test.t1.a)] | 956.3 KB | 0 Bytes |
| ├─TableReader_31(Build) | 9990.00 | 26880 | root | | time:3.85ms, loops:28, cop_task: {num: 8, max: 1.54ms, min: 104.6µs, avg: 553.4µs, p95: 1.54ms, tot_proc: 2ms, copr_cache_hit_ratio: 0.00, build_task_duration: 4.83µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:8, total_time:4.38ms}} | data:Selection_30 | 303.7 KB | N/A |
| │ └─Selection_30 | 9990.00 | 26880 | cop[tikv] | | tikv_task:{proc max:1.48ms, min:95.3µs, avg: 523.5µs, p80:1.2ms, p95:1.48ms, iters:0, tasks:8}, time_detail: {total_process_time: 2ms} | not(isnull(test.t2.a)) | N/A | N/A |
| │ └─TableFullScan_29 | 10000.00 | 26880 | cop[tikv] | table:t2 | tikv_task:{proc max:1.48ms, min:95.3µs, avg: 523.5µs, p80:1.2ms, p95:1.48ms, iters:0, tasks:8} | keep order:
false, stats:pseudo | N/A | N/A |
| └─TableReader_28(Probe) | 49102.85 | 49152 | root | | time:1.95ms, loops:49, cop_task: {num: 9, max: 3.37ms, min: 93.1µs, avg: 1ms, p95: 3.37ms, tot_proc: 6ms, copr_cache_hit_ratio: 0.00, build_task_duration: 1.27µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:9, total_time:8.96ms}} | data:Selection_27 | 532.7 KB | N/A |
| └─Selection_27 | 49102.85 | 49152 | cop[tikv] | | tikv_task:{proc max:3.27ms, min:74.8µs, avg: 965.3µs, p80:2.32ms, p95:3.27ms, iters:0, tasks:9}, time_detail: {total_process_time: 6ms} | not(isnull(test.t1.a)) | N/A | N/A |
| └─TableFullScan_26 | 49152.00 | 49152 | cop[tikv] | table:t1 | tikv_task:{proc max:3.27ms, min:74.8µs, avg: 965.3µs, p80:2.32ms, p95:3.27ms, iters:0, tasks:9} | keep order:
false, stats:partial[a:unInitialized] | N/A | N/A |
+--------------------------------+----------+-----------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+----------+---------+
8 rows
in
set (7.95 sec)
explain select (a, b) not
in (select a, b from naaj_B) from naaj_A;
explain select * from naaj_A
where NOT exists (select a, b from naaj_B
where
naaj_B.a = naaj_A.a and naaj_B.b = naaj_A.b) ;
注意: 现在集合谓词 IN 条件导致的 Join 没有 join key,IN 自身条件会在 other condition 里面,导致 Join 本身是个笛卡尔积的存在,这种 case 暂时还没有用 Null Aware 优化,需要手动改写 Exists 子查询。
create table t1(a int, b int);
create table t2(a int, b int, index ia(a));
explain select a > (select sum(b) from t2
where a = t1.b) from t1;
+------------------------------------+----------+-----------+---------------+-------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+------------------------------------+----------+-----------+---------------+-------------------------------------------------------------------------------------------+
| Projection_10 | 10000.00 | root | | gt(cast(test.t1.a, decimal(20,0) BINARY), Column
#10)->Column#11 |
| └─HashJoin_11 | 10000.00 | root | | left outer join, equal:[eq(test.t1.b, test.t2.a)] |
| ├─HashAgg_22(Build) | 7992.00 | root | | group by:test.t2.a, funcs:sum(Column
#13)->Column#10, funcs:firstrow(test.t2.a)->test.t2.a |
| │ └─TableReader_23 | 7992.00 | root | | data:HashAgg_15 |
| │ └─HashAgg_15 | 7992.00 | cop[tikv] | | group by:test.t2.a, funcs:sum(test.t2.b)->Column
#13 |
| │ └─Selection_21 | 9990.00 | cop[tikv] | | not(isnull(test.t2.a)) |
| │ └─TableFullScan_20 | 10000.00 | cop[tikv] | table:t2 | keep order:
false, stats:pseudo |
| └─TableReader_14(Probe) | 10000.00 | root | | data:TableFullScan_13 |
| └─TableFullScan_13 | 10000.00 | cop[tikv] | table:t1 | keep order:
false, stats:pseudo |
+------------------------------------+----------+-----------+---------------+-------------------------------------------------------------------------------------------+
mysql> explain select a > (select /*+ no_decorrelate() */ sum(b) from t2
where a = t1.b) from t1;
+------------------------------------------+-----------+-----------+-----------------------+------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+------------------------------------------+-----------+-----------+-----------------------+------------------------------------------------------------------------------+
| Projection_10 | 10000.00 | root | | gt(cast(test.t1.a, decimal(10,0) BINARY), Column
#10)->Column#11 |
| └─Apply_12 | 10000.00 | root | | CARTESIAN left outer join |
| ├─TableReader_14(Build) | 10000.00 | root | | data:TableFullScan_13 |
| │ └─TableFullScan_13 | 10000.00 | cop[tikv] | table:t1 | keep order:
false, stats:pseudo |
| └─MaxOneRow_15(Probe) | 10000.00 | root | | |
| └─StreamAgg_20 | 10000.00 | root | | funcs:sum(Column
#19)->Column#10 |
| └─Projection_45 | 100000.00 | root | | cast(test.t2.b, decimal(10,0) BINARY)->Column
#19 |
| └─IndexLookUp_44 | 100000.00 | root | | |
| ├─IndexRangeScan_42(Build) | 100000.00 | cop[tikv] | table:t2, index:ia(a) | range: decided by [eq(test.t2.a, test.t1.b)], keep order:
false, stats:pseudo |
| └─TableRowIDScan_43(Probe) | 100000.00 | cop[tikv] | table:t2 | keep order:
false, stats:pseudo |
+------------------------------------------+-----------+-----------+-----------------------+------------------------------------------------------------------------------+
10 rows
in
set (0.00 sec)
tidb> explain analyze select * from t1, t2
where t1.a = t2.a and t1.a=1;
+------------------------------+----------+------------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+------------------------------+----------+------------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
| HashJoin_8 | 9663.68 | 1073741824 | root | | time:22.7s, loops:1048577, RU:38.960331, build_hash_table:{total:29.3ms, fetch:28ms, build:1.31ms}, probe:{concurrency:5, total:1m51.7s, max:22.8s, probe:1m47.3s, fetch and
wait:4.41s} | CARTESIAN inner join | 1.14 MB | 0 Bytes |
| ├─TableReader_15(Build) | 98.30 | 32768 | root | | time:28.3ms, loops:33, cop_task: {num: 8, max: 12.7ms, min: 304.4µs, avg: 3.57ms, p95: 12.7ms, tot_proc: 25ms, copr_cache_hit_ratio: 0.00, build_task_duration: 3µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:8, total_time:28.5ms}} | data:Selection_14 | 399.7 KB | N/A |
| │ └─Selection_14 | 98.30 | 32768 | cop[tikv] | | tikv_task:{proc max:12.7ms, min:280.2µs, avg: 3.52ms, p80:7.09ms, p95:12.7ms, iters:0, tasks:8}, time_detail: {total_process_time: 25ms} | eq(1, test.t2.a) | N/A | N/A |
| │ └─TableFullScan_13 | 98304.00 | 98304 | cop[tikv] | table:t2 | tikv_task:{proc max:12.7ms, min:280.2µs, avg: 3.52ms, p80:7.09ms, p95:12.7ms, iters:0, tasks:8} | keep order:
false, stats:pseudo | N/A | N/A |
| └─TableReader_12(Probe) | 98.30 | 32768 | root | | time:6.3ms, loops:33, cop_task: {num: 8, max: 8.93ms, min: 329.4µs, avg: 2.89ms, p95: 8.93ms, tot_proc: 19ms, copr_cache_hit_ratio: 0.00, build_task_duration: 22.1µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:8, total_time:23ms}} | data:Selection_11 | 399.7 KB | N/A |
| └─Selection_11 | 98.30 | 32768 | cop[tikv] | | tikv_task:{proc max:8.83ms, min:304.7µs, avg: 2.83ms, p80:6.28ms, p95:8.83ms, iters:0, tasks:8}, time_detail: {total_process_time: 19ms} | eq(test.t1.a, 1) | N/A | N/A |
| └─TableFullScan_10 | 98304.00 | 98304 | cop[tikv] | table:t1 | tikv_task:{proc max:8.83ms, min:304.7µs, avg: 2.83ms, p80:6.28ms, p95:8.83ms, iters:0, tasks:8} | keep order:
false, stats:pseudo | N/A | N/A |
+------------------------------+----------+------------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
7 rows
in
set (22.83 sec)
mysql> explain analyze select * from t
where a < 10;
+-------------------------------+---------+---------+-----------+-------------------------+------------------------------------------------------------------------+-----------------------------------------------------+---------------+------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+-------------------------------+---------+---------+-----------+-------------------------+------------------------------------------------------------------------+-----------------------------------------------------+---------------+------+
| IndexLookUp_10 | 9.00 | 9 | root | | time:641.245µs, loops:2, rpc num: 1, rpc time:242.648µs, proc keys:0 | | 9.23046875 KB | N/A |
| ├─IndexRangeScan_8(Build) | 9.00 | 9 | cop[tikv] | table:t, index:idx_a(a) | time:142.94µs, loops:10, | range:[-inf,10), keep order:
false | N/A | N/A |
| └─TableRowIDScan_9(Probe) | 9.00 | 9 | cop[tikv] | table:t | time:141.128µs, loops:10 | keep order:
false | N/A | N/A |
+-------------------------------+---------+---------+-----------+-------------------------+------------------------------------------------------------------------+-----------------------------------------------------+---------------+------+
3 rows
in
set (0.00 sec)
=drop table
if exists t1;
create table t1(c1 int, c2 int, c3 int, key(c1), key(c2));
insert into t1 values(4, 4, 4), (5, 5, 5);
insert into t1 select * from t1; * N;
drop table
if exists t2;
create table t2(c1 int, c2 int, c3 int, key(c1), key(c2));
insert into t2 values(1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5);
tidb> explain select * from t1
where c1 < 2 or c2 < 2 and c3 < ANY(select count(1) from t2);
+----------------------------------+------------+-----------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+----------------------------------+------------+-----------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| HashJoin_12 | 3355443.20 | root | | CARTESIAN inner join, other cond:or(lt(test.t1.c1, 2), and(and(lt(test.t1.c2, 2), or(lt(test.t1.c3, Column
#10), if(ne(Column#11, 0), NULL, 0))), and(ne(Column#12, 0), if(isnull(test.t1.c3), NULL, 1)))) |
| ├─StreamAgg_18(Build) | 1.00 | root | | funcs:max(Column
#9)->Column#10, funcs:sum(0)->Column#11, funcs:count(1)->Column#12 |
| │ └─StreamAgg_38 | 1.00 | root | | funcs:count(Column
#22)->Column#9 |
| │ └─IndexReader_39 | 1.00 | root | | index:StreamAgg_22 |
| │ └─StreamAgg_22 | 1.00 | cop[tikv] | | funcs:count(1)->Column
#22 |
| │ └─IndexFullScan_36 | 5.00 | cop[tikv] | table:t2, index:c1(c1) | keep order:
false, stats:pseudo |
| └─TableReader_16(Probe) | 3355443.20 | root | | data:Selection_15 |
| └─Selection_15 | 3355443.20 | cop[tikv] | | or(lt(test.t1.c1, 2), and(lt(test.t1.c2, 2),
if(isnull(test.t1.c3), NULL, 1))) |
| └─TableFullScan_14 | 4194304.00 | cop[tikv] | table:t1 | keep order:
false |
+----------------------------------+------------+-----------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9 rows
in
set, 1 warning (0.00 sec)
tidb> explain analyze select * from t1
where c1 < 2 or c2 < 2 and c3 < ANY(select count(1) from t2);
+----------------------------------+------------+---------+-----------+------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+----------------------------------+------------+---------+-----------+------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
| HashJoin_12 | 1677721.60 | 0 | root | | time:4.74s, loops:1, RU:27860.254239, build_hash_table:{total:44.9ms, fetch:44.9ms, build:3.46µs} | CARTESIAN inner join, other cond:or(lt(test.t1.c1, 2), and(and(lt(test.t1.c2, 2), or(lt(test.t1.c3, Column
#10), if(ne(Column#11, 0), NULL, 0))), and(ne(Column#12, 0), if(isnull(test.t1.c3), NULL, 1)))) | 59.2 KB | 0 Bytes |
| ├─StreamAgg_18(Build) | 1.00 | 1 | root | | time:44.8ms, loops:2 | funcs:max(Column
#9)->Column#10, funcs:sum(0)->Column#11, funcs:count(1)->Column#12 | 460 Bytes | N/A |
| │ └─StreamAgg_38 | 1.00 | 1 | root | | time:44.8ms, loops:2 | funcs:count(Column
#22)->Column#9 | 8.25 KB | N/A |
| │ └─IndexReader_39 | 1.00 | 1 | root | | time:44.8ms, loops:2, cop_task: {num: 1, max: 110.8µs, proc_keys: 0, copr_cache_hit_ratio: 0.00, build_task_duration: 1.29µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:1, total_time:98.5µs}} | index:StreamAgg_22 | 204 Bytes | N/A |
| │ └─StreamAgg_22 | 1.00 | 1 | cop[tikv] | | tikv_task:{time:84.3µs, loops:0} | funcs:count(1)->Column
#22 | N/A | N/A |
| │ └─IndexFullScan_36 | 5.00 | 5 | cop[tikv] | table:t2, index:c1(c1) | tikv_task:{time:84.3µs, loops:0} | keep order:
false, stats:pseudo | N/A | N/A |
| └─TableReader_16(Probe) | 1677721.60 | 0 | root | | time:4.74s, loops:1, cop_task: {num: 6, max: 1.1s, min: 33.9ms, avg: 496ms, p95: 1.1s, tot_proc: 2.94s, copr_cache_hit_ratio: 0.00, build_task_duration: 28.1µs, max_distsql_concurrency: 6}, rpc_info:{Cop:{num_rpc:55382, total_time:9.87s},ResolveLock:{num_rpc:55376, total_time:635.4ms}} | data:Selection_15 | 224 Bytes | N/A |
| └─Selection_15 | 1677721.60 | 0 | cop[tikv] | | tikv_task:{proc max:1.09s, min:33.9ms, avg: 490.6ms, p80:839.3ms, p95:1.09s, iters:0, tasks:6}, time_detail: {total_process_time: 2.94s} | or(lt(test.t1.c1, 2), and(lt(test.t1.c2, 2),
if(isnull(test.t1.c3), NULL, 1))) | N/A | N/A |
| └─TableFullScan_14 | 2097152.00 | 4194304 | cop[tikv] | table:t1 | tikv_task:{proc max:1.09s, min:33.9ms, avg: 490.6ms, p80:839.3ms, p95:1.09s, iters:0, tasks:6} | keep order:
false | N/A | N/A |
+----------------------------------+------------+---------+-----------+------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
9 rows
in
set, 1 warning (4.75 sec)
tidb> explain analyze select /*+ use_index_merge(t1) */ * from t1 where c1 < 2 or c2 < 2 and c3 < ANY(select count(1) from t2);
+----------------------------------+------------+---------+-----------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+----------------------------------+------------+---------+-----------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
| HashJoin_12 | 3355443.20 | 0 | root | | time:87ms, loops:1, RU:68.567903, build_hash_table:{total:462.6µs, fetch:453.8µs, build:8.88µs} | CARTESIAN inner join, other cond:or(lt(test.t1.c1, 2), and(and(lt(test.t1.c2, 2), or(lt(test.t1.c3, Column #10), if(ne(Column#11, 0), NULL, 0))), and(ne(Column#12, 0), if(isnull(test.t1.c3), NULL, 1)))) | 60.7 KB | 0 Bytes |
| ├─StreamAgg_23(Build) | 1.00 | 1 | root | | time:362µs, loops:2 | funcs:max(Column #9)->Column#10, funcs:sum(0)->Column#11, funcs:count(1)->Column#12 | 460 Bytes | N/A |
| │ └─StreamAgg_43 | 1.00 | 1 | root | | time:338.2µs, loops:2 | funcs:count(Column #25)->Column#9 | 8.25 KB | N/A |
| │ └─IndexReader_44 | 1.00 | 1 | root | | time:331.1µs, loops:2, cop_task: {num: 1, max: 404.3µs, proc_keys: 0, copr_cache_hit_ratio: 0.00, build_task_duration: 30µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:1, total_time:373.3µs}} | index:StreamAgg_27 | 204 Bytes | N/A |
| │ └─StreamAgg_27 | 1.00 | 1 | cop[tikv] | | tikv_task:{time:323.8µs, loops:0} | funcs:count(1)->Column #25 | N/A | N/A |
| │ └─IndexFullScan_41 | 5.00 | 5 | cop[tikv] | table:t2, index:c1(c1) | tikv_task:{time:323.8µs, loops:0} | keep order: false, stats:pseudo | N/A | N/A |
| └─IndexMerge_21(Probe) | 2684354.56 | 0 | root | | time:86.8ms, loops:1 | type: union | 200 Bytes | N/A |
| ├─IndexRangeScan_17(Build) | 0.00 | 0 | cop[tikv] | table:t1, index:c1(c1) | time:85.5ms, loops:1, cop_task: {num: 1, max: 85.5ms, proc_keys: 0, tot_proc: 85ms, copr_cache_hit_ratio: 0.00, build_task_duration: 219.3µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:1, total_time:85.5ms}}, tikv_task:{time:85.4ms, loops:0}, time_detail: {total_process_time: 85ms} | range:[-inf,2), keep order: false | N/A | N/A |
| ├─IndexRangeScan_18(Build) | 0.00 | 0 | cop[tikv] | table:t1, index:c2(c2) | time:62.2ms, loops:1, cop_task: {num: 2, max: 62.1ms, min: 53.8ms, avg: 57.9ms, p95: 62.1ms, tot_proc: 115ms, copr_cache_hit_ratio: 0.00, build_task_duration: 43.8µs, max_distsql_concurrency: 2}, rpc_info:{Cop:{num_rpc:2, total_time:115.8ms}}, tikv_task:{proc max:62.1ms, min:53.7ms, avg: 57.9ms, p80:62.1ms, p95:62.1ms, iters:0, tasks:2}, time_detail: {total_process_time: 115ms} | range:[-inf,2), keep order: false | N/A | N/A |
| └─Selection_20(Probe) | 2684354.56 | 0 | cop[tikv] | | | or(lt(test.t1.c1, 2), and(lt(test.t1.c2, 2), if(isnull(test.t1.c3), NULL, 1))) | N/A | N/A |
| └─TableRowIDScan_19 | 3355443.20 | 0 | cop[tikv] | table:t1 | | keep order: false | N/A | N/A |
+----------------------------------+------------+---------+-----------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
11 rows in set, 1 warning (0.09 sec)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69994146/viewspace-3035306/ ,如需转载,请注明出处,否则将追究法律责任。