replayer_D8MQbKVBQSEfTHN59IRl3Q==_1695027299225316789.zip|attachment (70.9 KB)
已上传,感谢。目前看是小表(小结果集)join 大表(大结果集)返回大结果集的情况下更应该倾向于走HashJoin,但这里走了IndexHashJoin。
另外,如下是基于统计信息和真实运行值评估的统计信息,看是否也有所帮助:
--基于统计信息cost值评估
mysql> explain analyze format='verbose' select /*+ hash_join(a,b) */ * from nation a join customer b on a.N_NATIONKEY=b.C_NATIONKEY;
+-----------------------------+------------+--------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+---------+---------+
| id | estRows | estCost | actRows | task | access object | execution info | operator info | memory | disk |
+-----------------------------+------------+--------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+---------+---------+
| HashJoin_30 | 1500000.00 | 158260319.14 | 1500000 | root | | time:604.1ms, loops:1468, RU:4677.543332, build_hash_table:{total:845.3µs, fetch:832.7µs, build:12.6µs}, probe:{concurrency:5, total:3.02s, max:604.6ms, probe:1.04s, fetch:1.98s} | inner join, equal:[eq(tpch10.nation.n_nationkey, tpch10.customer.c_nationkey)] | 66.0 KB | 0 Bytes |
| ├─TableReader_32(Build) | 25.00 | 1588.68 | 25 | root | | time:816.1µs, loops:2, cop_task: {num: 1, max: 833.2µs, proc_keys: 25, tot_proc: 110.8µs, tot_wait: 188.7µs, rpc_num: 1, rpc_time: 798.2µs, copr_cache_hit_ratio: 0.00, build_task_duration: 11.4µs, max_distsql_concurrency: 1} | data:TableFullScan_31 | 3.05 KB | N/A |
| │ └─TableFullScan_31 | 25.00 | 7495.23 | 25 | cop[tikv] | table:a | tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 25, total_process_keys_size: 3109, total_keys: 26, get_snapshot_time: 23.6µs, rocksdb: {key_skipped_count: 25, block: {cache_hit_count: 1}}} | keep order:false, stats:pseudo | N/A | N/A |
| └─TableReader_34(Probe) | 1500000.00 | 128313913.46 | 1500000 | root | | time:332.3ms, loops:1472, cop_task: {num: 88, max: 185.4ms, min: 388.7µs, avg: 40.9ms, p95: 153.7ms, max_proc_keys: 50144, p95_proc_keys: 50144, tot_proc: 2.11s, tot_wait: 32.5ms, rpc_num: 88, rpc_time: 3.59s, copr_cache_hit_ratio: 0.61, build_task_duration: 14µs, max_distsql_concurrency: 7} | data:TableFullScan_33 | 45.0 MB | N/A |
| └─TableFullScan_33 | 1500000.00 | 483664701.94 | 1500000 | cop[tikv] | table:b | tikv_task:{proc max:91ms, min:0s, avg: 23.5ms, p80:47ms, p95:66ms, iters:1811, tasks:88}, scan_detail: {total_process_keys: 1265952, total_process_keys_size: 257589695, total_keys: 1265986, get_snapshot_time: 4.82ms, rocksdb: {key_skipped_count: 1265952, block: {cache_hit_count: 8493}}} | keep order:false, stats:partial[idx2:missing] | N/A | N/A |
+-----------------------------+------------+--------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+---------+---------+
5 rows in set, 1 warning (0.60 sec)
mysql> explain analyze format='verbose' select /*+ inl_hash_join(a,b) */ * from nation a join customer b on a.N_NATIONKEY=b.C_NATIONKEY;
+----------------------------------+------------+--------------+---------+-----------+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| id | estRows | estCost | actRows | task | access object | execution info | operator info | memory | disk |
+----------------------------------+------------+--------------+---------+-----------+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| IndexHashJoin_14 | 1500000.00 | 98202514.61 | 1500000 | root | | time:3.3s, loops:1466, RU:9913.581754, inner:{total:3.3s, concurrency:5, task:1, construct:11.8µs, fetch:2.71s, build:8.2µs, join:595ms} | inner join, inner:IndexLookUp_11, outer key:tpch10.nation.n_nationkey, inner key:tpch10.customer.c_nationkey, equal cond:eq(tpch10.nation.n_nationkey, tpch10.customer.c_nationkey) | 407.2 MB | N/A |
| ├─TableReader_30(Build) | 25.00 | 1588.68 | 25 | root | | time:754µs, loops:3, cop_task: {num: 1, max: 816.6µs, proc_keys: 25, tot_proc: 98.8µs, tot_wait: 104µs, rpc_num: 1, rpc_time: 794.5µs, copr_cache_hit_ratio: 0.00, build_task_duration: 6.35µs, max_distsql_concurrency: 1} | data:TableFullScan_29 | 3.05 KB | N/A |
| │ └─TableFullScan_29 | 25.00 | 7495.23 | 25 | cop[tikv] | table:a | tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 25, total_process_keys_size: 3109, total_keys: 26, get_snapshot_time: 23.4µs, rocksdb: {key_skipped_count: 25, block: {cache_hit_count: 1}}} | keep order:false, stats:pseudo | N/A | N/A |
| └─IndexLookUp_11(Probe) | 1500000.00 | 117823847.31 | 1500000 | root | | time:2.68s, loops:1466, index_task: {total_time: 2.61s, fetch_handle: 142.5ms, build: 270.4µs, wait: 2.47s}, table_task: {total_time: 13.2s, num: 77, concurrency: 5}, next: {wait_index: 2.64ms, wait_table_lookup_build: 318.9µs, wait_table_lookup_resp: 1.35s} | | 35.7 MB | N/A |
| ├─IndexRangeScan_9(Build) | 1500000.00 | 12210000.00 | 1500000 | cop[tikv] | table:b, index:idx2(C_NATIONKEY) | time:42.9ms, loops:1476, cop_task: {num: 63, max: 143.8ms, min: 252.6µs, avg: 23.9ms, p95: 122.3ms, max_proc_keys: 50144, p95_proc_keys: 50144, tot_proc: 532.5ms, tot_wait: 22.7ms, rpc_num: 63, rpc_time: 1.5s, copr_cache_hit_ratio: 0.57, build_task_duration: 27.7µs, max_distsql_concurrency: 6}, tikv_task:{proc max:113ms, min:0s, avg: 28.2ms, p80:64ms, p95:83ms, iters:1707, tasks:63}, scan_detail: {total_process_keys: 485824, total_process_keys_size: 22347904, total_keys: 485859, get_snapshot_time: 1.21ms, rocksdb: {key_skipped_count: 1457472, block: {cache_hit_count: 1911}}} | range: decided by [eq(tpch10.customer.c_nationkey, tpch10.nation.n_nationkey)], keep order:false, stats:partial[idx2:missing] | N/A | N/A |
| └─TableRowIDScan_10(Probe) | 1500000.00 | 19346588.08 | 1500000 | cop[tikv] | table:b | time:12s, loops:1657, cop_task: {num: 280, max: 261.3ms, min: 3.16ms, avg: 106.5ms, p95: 194ms, max_proc_keys: 15718, p95_proc_keys: 9045, tot_proc: 13.7s, tot_wait: 208.3ms, rpc_num: 280, rpc_time: 29.8s, copr_cache_hit_ratio: 0.00, build_task_duration: 228.8ms, max_distsql_concurrency: 6}, tikv_task:{proc max:178ms, min:0s, avg: 65.1ms, p80:110ms, p95:141ms, iters:2719, tasks:280}, scan_detail: {total_process_keys: 1500000, total_process_keys_size: 305225771, total_keys: 1559447, get_snapshot_time: 20.6ms, rocksdb: {key_skipped_count: 121554, block: {cache_hit_count: 378675}}} | keep order:false, stats:partial[idx2:missing] | N/A | N/A |
+----------------------------------+------------+--------------+---------+-----------+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
6 rows in set, 1 warning (3.30 sec)
--基于真实结果cost值评估
mysql> explain analyze format='true_card_cost' select /*+ hash_join(a,b) */ * from nation a join customer b on a.N_NATIONKEY=b.C_NATIONKEY;
+-----------------------------+------------+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+---------+---------+
| id | estRows | estCost | costFormula | actRows | task | access object | execution info | operator info | memory | disk |
+-----------------------------+------------+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+---------+---------+
| HashJoin_30 | 1500000.00 | 158260319.14 | (cpu(10*3*tidb_cpu_factor(49.9))) + (((scan(25*logrowsize(165)*tikv_scan_factor(40.7))) + (net(25*rowsize(165)*tidb_kv_net_factor(3.96))))/15.00) + (((scan(1.5e+06*logrowsize(242.6)*tikv_scan_factor(40.7))) + (net(1.5e+06*rowsize(242.6)*tidb_kv_net_factor(3.96))))/15.00) + ((hashkey(25*1*tidb_cpu_factor(49.9))) + (hashmem(25*165*tidb_mem_factor(0.2))) + (hashbuild(25*tidb_cpu_factor(49.9)))) + (cpu(25*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(1.5e+06*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(1.5e+06*1*tidb_cpu_factor(49.9))) + (hashprobe(1.5e+06*tidb_cpu_factor(49.9)))))/5.00) | 1500000 | root | | time:673.2ms, loops:1469, RU:4798.995745, build_hash_table:{total:1.21ms, fetch:1.2ms, build:18.2µs}, probe:{concurrency:5, total:3.37s, max:673.5ms, probe:965.1ms, fetch:2.4s} | inner join, equal:[eq(tpch10.nation.n_nationkey, tpch10.customer.c_nationkey)] | 50.2 KB | 0 Bytes |
| ├─TableReader_32(Build) | 25.00 | 1588.68 | ((scan(25*logrowsize(165)*tikv_scan_factor(40.7))) + (net(25*rowsize(165)*tidb_kv_net_factor(3.96))))/15.00 | 25 | root | | time:1.08ms, loops:2, cop_task: {num: 1, max: 1.39ms, proc_keys: 25, tot_proc: 113.1µs, tot_wait: 506.7µs, rpc_num: 1, rpc_time: 1.2ms, copr_cache_hit_ratio: 0.00, build_task_duration: 10.4µs, max_distsql_concurrency: 1} | data:TableFullScan_31 | 3.05 KB | N/A |
| │ └─TableFullScan_31 | 25.00 | 7495.23 | scan(25*logrowsize(165)*tikv_scan_factor(40.7)) | 25 | cop[tikv] | table:a | tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 25, total_process_keys_size: 3109, total_keys: 26, get_snapshot_time: 29.8µs, rocksdb: {key_skipped_count: 25, block: {cache_hit_count: 1}}} | keep order:false, stats:pseudo | N/A | N/A |
| └─TableReader_34(Probe) | 1500000.00 | 128313913.46 | ((scan(1.5e+06*logrowsize(242.6)*tikv_scan_factor(40.7))) + (net(1.5e+06*rowsize(242.6)*tidb_kv_net_factor(3.96))))/15.00 | 1500000 | root | | time:409.2ms, loops:1472, cop_task: {num: 88, max: 287.8ms, min: 586.6µs, avg: 45.9ms, p95: 194.8ms, max_proc_keys: 50144, p95_proc_keys: 50144, tot_proc: 2.48s, tot_wait: 22.6ms, rpc_num: 88, rpc_time: 4.04s, copr_cache_hit_ratio: 0.61, build_task_duration: 11.4µs, max_distsql_concurrency: 7} | data:TableFullScan_33 | 39.2 MB | N/A |
| └─TableFullScan_33 | 1500000.00 | 483664701.94 | scan(1.5e+06*logrowsize(242.6)*tikv_scan_factor(40.7)) | 1500000 | cop[tikv] | table:b | tikv_task:{proc max:126ms, min:1ms, avg: 25.8ms, p80:47ms, p95:77ms, iters:1811, tasks:88}, scan_detail: {total_process_keys: 1265952, total_process_keys_size: 257589695, total_keys: 1265986, get_snapshot_time: 1.45ms, rocksdb: {key_skipped_count: 1265952, block: {cache_hit_count: 8493}}} | keep order:false, stats:partial[idx2:missing] | N/A | N/A |
+-----------------------------+------------+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+---------+---------+
5 rows in set, 3 warnings (0.68 sec)
mysql> show warnings;
+---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1105 | cost formula: (cpu(10*3*tidb_cpu_factor(49.9))) + (((scan(25*logrowsize(165)*tikv_scan_factor(40.7))) + (net(25*rowsize(165)*tidb_kv_net_factor(3.96))))/15.00) + (((scan(1.5e+06*logrowsize(242.6)*tikv_scan_factor(40.7))) + (net(1.5e+06*rowsize(242.6)*tidb_kv_net_factor(3.96))))/15.00) + ((hashkey(25*1*tidb_cpu_factor(49.9))) + (hashmem(25*165*tidb_mem_factor(0.2))) + (hashbuild(25*tidb_cpu_factor(49.9)))) + (cpu(25*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(1.5e+06*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(1.5e+06*1*tidb_cpu_factor(49.9))) + (hashprobe(1.5e+06*tidb_cpu_factor(49.9)))))/5.00) |
| Warning | 1105 | factor costs: {"tidb_cpu_factor":29943992,"tidb_kv_net_factor":96070689,"tidb_mem_factor":825,"tikv_scan_factor":32244813.144939117} |
| Warning | 1105 | factor weights: {"tidb_cpu_factor":600080,"tidb_kv_net_factor":24260275,"tidb_mem_factor":4125,"tikv_scan_factor":792255.8512270052} |
+---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
mysql> explain analyze format='true_card_cost' select /*+ inl_hash_join(a,b) */ * from nation a join customer b on a.N_NATIONKEY=b.C_NATIONKEY;
+----------------------------------+------------+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| id | estRows | estCost | costFormula | actRows | task | access object | execution info | operator info | memory | disk |
+----------------------------------+------------+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
| IndexHashJoin_14 | 1500000.00 | 98202514.61 | (cpu(10*3*tidb_cpu_factor(49.9))) + (((scan(25*logrowsize(165)*tikv_scan_factor(40.7))) + (net(25*rowsize(165)*tidb_kv_net_factor(3.96))))/15.00) + (cpu(25*filters(0)*tidb_cpu_factor(49.9))) + (cpu(25*10*tidb_cpu_factor(49.9))) + ((() + ((((((net(60000*rowsize(16.25)*tidb_kv_net_factor(3.96))) + (scan(60000*logrowsize(32)*tikv_scan_factor(40.7))))/15.00) + (((((net(60000*rowsize(219.60000000000002)*tidb_kv_net_factor(3.96))) + (scan(60000*logrowsize(242.6)*tikv_scan_factor(40.7))))/15.00) + ((double-read-cpu(60000*tidb_cpu_factor(49.9))) + (doubleRead(tasks(96)*tidb_request_factor(6e+06)))))/5.00))*25.00)/6.00) + (cpu(1.5e+06*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(25*0*tidb_cpu_factor(49.9))) + (hashmem(25*165*tidb_mem_factor(0.2))) + (hashbuild(25*tidb_cpu_factor(49.9)))))/5.00) | 1500000 | root | | time:3.13s, loops:1466, RU:9641.506148, inner:{total:3.13s, concurrency:5, task:1, construct:15.5µs, fetch:2.64s, build:8.81µs, join:488.4ms} | inner join, inner:IndexLookUp_11, outer key:tpch10.nation.n_nationkey, inner key:tpch10.customer.c_nationkey, equal cond:eq(tpch10.nation.n_nationkey, tpch10.customer.c_nationkey) | 407.4 MB | N/A |
| ├─TableReader_30(Build) | 25.00 | 1588.68 | ((scan(25*logrowsize(165)*tikv_scan_factor(40.7))) + (net(25*rowsize(165)*tidb_kv_net_factor(3.96))))/15.00 | 25 | root | | time:953.6µs, loops:3, cop_task: {num: 1, max: 877.9µs, proc_keys: 25, tot_proc: 109.6µs, tot_wait: 97.5µs, rpc_num: 1, rpc_time: 839.4µs, copr_cache_hit_ratio: 0.00, build_task_duration: 12.5µs, max_distsql_concurrency: 1} | data:TableFullScan_29 | 3.05 KB | N/A |
| │ └─TableFullScan_29 | 25.00 | 7495.23 | scan(25*logrowsize(165)*tikv_scan_factor(40.7)) | 25 | cop[tikv] | table:a | tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 25, total_process_keys_size: 3109, total_keys: 26, get_snapshot_time: 25.6µs, rocksdb: {key_skipped_count: 25, block: {cache_hit_count: 1}}} | keep order:false, stats:pseudo | N/A | N/A |
| └─IndexLookUp_11(Probe) | 1500000.00 | 117823847.31 | (((net(60000*rowsize(16.25)*tidb_kv_net_factor(3.96))) + (scan(60000*logrowsize(32)*tikv_scan_factor(40.7))))/15.00) + (((((net(60000*rowsize(219.60000000000002)*tidb_kv_net_factor(3.96))) + (scan(60000*logrowsize(242.6)*tikv_scan_factor(40.7))))/15.00) + ((double-read-cpu(60000*tidb_cpu_factor(49.9))) + (doubleRead(tasks(96)*tidb_request_factor(6e+06)))))/5.00) | 1500000 | root | | time:2.61s, loops:1466, index_task: {total_time: 2.52s, fetch_handle: 150ms, build: 228.3µs, wait: 2.37s}, table_task: {total_time: 12.8s, num: 77, concurrency: 5}, next: {wait_index: 19.5ms, wait_table_lookup_build: 192.7µs, wait_table_lookup_resp: 1.48s} | | 38.7 MB | N/A |
| ├─IndexRangeScan_9(Build) | 1500000.00 | 12210000.00 | scan(60000*logrowsize(32)*tikv_scan_factor(40.7)) | 1500000 | cop[tikv] | table:b, index:idx2(C_NATIONKEY) | time:35.8ms, loops:1476, cop_task: {num: 63, max: 175ms, min: 280.4µs, avg: 24.2ms, p95: 115.8ms, max_proc_keys: 50144, p95_proc_keys: 50144, tot_proc: 397.3ms, tot_wait: 55.6ms, rpc_num: 63, rpc_time: 1.52s, copr_cache_hit_ratio: 0.56, build_task_duration: 35.5µs, max_distsql_concurrency: 6}, tikv_task:{proc max:97ms, min:0s, avg: 27.6ms, p80:63ms, p95:77ms, iters:1707, tasks:63}, scan_detail: {total_process_keys: 535968, total_process_keys_size: 24654528, total_keys: 536005, get_snapshot_time: 1.01ms, rocksdb: {key_skipped_count: 1607904, block: {cache_hit_count: 2105}}} | range: decided by [eq(tpch10.customer.c_nationkey, tpch10.nation.n_nationkey)], keep order:false, stats:partial[idx2:missing] | N/A | N/A |
| └─TableRowIDScan_10(Probe) | 1500000.00 | 19346588.08 | scan(60000*logrowsize(242.6)*tikv_scan_factor(40.7)) | 1500000 | cop[tikv] | table:b | time:11.9s, loops:1664, cop_task: {num: 276, max: 286.2ms, min: 960µs, avg: 103.2ms, p95: 192.3ms, max_proc_keys: 13960, p95_proc_keys: 9099, tot_proc: 12.9s, tot_wait: 188.6ms, rpc_num: 276, rpc_time: 28.4s, copr_cache_hit_ratio: 0.00, build_task_duration: 135.1ms, max_distsql_concurrency: 5, max_extra_concurrency: 1}, tikv_task:{proc max:227ms, min:0s, avg: 64.1ms, p80:108ms, p95:140ms, iters:2696, tasks:276}, scan_detail: {total_process_keys: 1500000, total_process_keys_size: 305225771, total_keys: 1559018, get_snapshot_time: 13.4ms, rocksdb: {key_skipped_count: 120663, block: {cache_hit_count: 379095}}} | keep order:false, stats:partial[idx2:missing] | N/A | N/A |
+----------------------------------+------------+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+------+
6 rows in set, 3 warnings (3.13 sec)
mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1105 | cost formula: (cpu(10*3*tidb_cpu_factor(49.9))) + (((scan(25*logrowsize(165)*tikv_scan_factor(40.7))) + (net(25*rowsize(165)*tidb_kv_net_factor(3.96))))/15.00) + (cpu(25*filters(0)*tidb_cpu_factor(49.9))) + (cpu(25*10*tidb_cpu_factor(49.9))) + ((() + ((((((net(60000*rowsize(16.25)*tidb_kv_net_factor(3.96))) + (scan(60000*logrowsize(32)*tikv_scan_factor(40.7))))/15.00) + (((((net(60000*rowsize(219.60000000000002)*tidb_kv_net_factor(3.96))) + (scan(60000*logrowsize(242.6)*tikv_scan_factor(40.7))))/15.00) + ((double-read-cpu(60000*tidb_cpu_factor(49.9))) + (doubleRead(tasks(96)*tidb_request_factor(6e+06)))))/5.00))*25.00)/6.00) + (cpu(1.5e+06*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(25*0*tidb_cpu_factor(49.9))) + (hashmem(25*165*tidb_mem_factor(0.2))) + (hashbuild(25*tidb_cpu_factor(49.9)))))/5.00) |
| Warning | 1105 | factor costs: {"tidb_cpu_factor":513221.5,"tidb_kv_net_factor":795333,"tidb_mem_factor":165,"tidb_request_factor":96000000,"tikv_scan_factor":893795.1052751924} |
| Warning | 1105 | factor weights: {"tidb_cpu_factor":10285,"tidb_kv_net_factor":200841.66666666666,"tidb_mem_factor":825,"tidb_request_factor":16,"tikv_scan_factor":21960.567697179173} |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)