好的,我在跑diff时,cpu是利用率时不时回到90%多
这个指令好像有问题,我自己修改了一下,你看一下是不是你要的:
MySQL [tpcc10g]> explain analyze select BIT_XOR(CAST(CRC32(CONCAT_WS(’,’, c_w_id,c_d_id,c_id,c_discount,c_credit,c_last,c_first,c_credit_lim,c_balance,c_ytd_payment,c_payment_cnt,c_delivery_cnt,c_street_1,c_street_2,c_city,c_state,c_zip,c_phone,c_since,c_middle,c_data,CONCAT(c_w_id,c_d_id,c_id,c_discount,c_credit,c_last,c_first,c_credit_lim,c_balance,c_ytd_payment,c_payment_cnt,c_delivery_cnt,c_street_1,c_street_2,c_city,c_state,c_zip,c_phone,c_since,c_middle,c_data)))AS UNSIGNED)) AS checksum from bmsql_customer where (((c_w_id
> ‘1’) OR (c_w_id
= ‘1’ AND c_d_id
> ‘2’) OR (c_w_id
= ‘1’ AND c_d_id
= ‘2’ AND c_id
> ‘632’)) AND ((c_w_id
< ‘1’) OR (c_w_id
= ‘1’ AND c_d_id
< ‘2’) OR (c_w_id
= ‘1’ AND c_d_id
= ‘2’ AND c_id
<= ‘736’)) AND TRUE);
±-----------------------------±-----------±--------±----------±---------------------±------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±----------±-----+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
±-----------------------------±-----------±--------±----------±---------------------±------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±----------±-----+
| StreamAgg_36 | 1.00 | 1 | root | | time:795.123108ms, loops:2 | funcs:bit_xor(Column#30)->Column#23 | 372 Bytes | N/A |
| └─TableReader_37 | 1.00 | 28 | root | | time:795.108823ms, loops:2, cop_task: {num: 28, max: 549.362472ms, min: 128.971805ms, avg: 357.661512ms, p95: 444.007678ms, max_proc_keys: 194418, p95_proc_keys: 189523, tot_proc: 9.963s, tot_wait: 15ms, rpc_num: 28, rpc_time: 10.013634302s, copr_cache_hit_ratio: 0.00} | data:StreamAgg_9 | 316 Bytes | N/A |
| └─StreamAgg_9 | 1.00 | 28 | cop[tikv] | | time:0ns, loops:0, tikv_task:{proc max:547ms, min:127ms, p80:414ms, p95:442ms, iters:4112, tasks:28} | funcs:bit_xor(cast(crc32(concat_ws(",", cast(tpcc10g.bmsql_customer.c_w_id), cast(tpcc10g.bmsql_customer.c_d_id), cast(tpcc10g.bmsql_customer.c_id), cast(tpcc10g.bmsql_customer.c_discount), tpcc10g.bmsql_customer.c_credit, tpcc10g.bmsql_customer.c_last, tpcc10g.bmsql_customer.c_first, cast(tpcc10g.bmsql_customer.c_credit_lim), cast(tpcc10g.bmsql_customer.c_balance), cast(tpcc10g.bmsql_customer.c_ytd_payment), cast(tpcc10g.bmsql_customer.c_payment_cnt), cast(tpcc10g.bmsql_customer.c_delivery_cnt), tpcc10g.bmsql_customer.c_street_1, tpcc10g.bmsql_customer.c_street_2, tpcc10g.bmsql_customer.c_city, tpcc10g.bmsql_customer.c_state, tpcc10g.bmsql_customer.c_zip, tpcc10g.bmsql_customer.c_phone, cast(tpcc10g.bmsql_customer.c_since), tpcc10g.bmsql_customer.c_middle, tpcc10g.bmsql_customer.c_data, concat(cast(tpcc10g.bmsql_customer.c_w_id), cast(tpcc10g.bmsql_customer.c_d_id), cast(tpcc10g.bmsql_customer.c_id), cast(tpcc10g.bmsql_customer.c_discount), tpcc10g.bmsql_customer.c_credit, tpcc10g.bmsql_customer.c_last, tpcc10g.bmsql_customer.c_first, cast(tpcc10g.bmsql_customer.c_credit_lim), cast(tpcc10g.bmsql_customer.c_balance), cast(tpcc10g.bmsql_customer.c_ytd_payment), cast(tpcc10g.bmsql_customer.c_payment_cnt), cast(tpcc10g.bmsql_customer.c_delivery_cnt), tpcc10g.bmsql_customer.c_street_1, tpcc10g.bmsql_customer.c_street_2, tpcc10g.bmsql_customer.c_city, tpcc10g.bmsql_customer.c_state, tpcc10g.bmsql_customer.c_zip, tpcc10g.bmsql_customer.c_phone, cast(tpcc10g.bmsql_customer.c_since), tpcc10g.bmsql_customer.c_middle, tpcc10g.bmsql_customer.c_data)))))->Column#30 | N/A | N/A |
| └─Selection_35 | 3360000.00 | 104 | cop[tikv] | | time:0ns, loops:0, tikv_task:{proc max:544ms, min:126ms, p80:412ms, p95:442ms, iters:4112, tasks:28} | or(or(gt(tpcc10g.bmsql_customer.c_w_id, 1), and(eq(tpcc10g.bmsql_customer.c_w_id, 1), gt(tpcc10g.bmsql_customer.c_d_id, 2))), and(and(eq(tpcc10g.bmsql_customer.c_w_id, 1), eq(tpcc10g.bmsql_customer.c_d_id, 2)), gt(tpcc10g.bmsql_customer.c_id, 632))), or(or(lt(tpcc10g.bmsql_customer.c_w_id, 1), and(eq(tpcc10g.bmsql_customer.c_w_id, 1), lt(tpcc10g.bmsql_customer.c_d_id, 2))), and(and(eq(tpcc10g.bmsql_customer.c_w_id, 1), eq(tpcc10g.bmsql_customer.c_d_id, 2)), le(tpcc10g.bmsql_customer.c_id, 736))) | N/A | N/A |
| └─TableFullScan_34 | 4200000.00 | 4200000 | cop[tikv] | table:bmsql_customer | time:0ns, loops:0, tikv_task:{proc max:514ms, min:116ms, p80:388ms, p95:414ms, iters:4112, tasks:28} | keep order:false | N/A | N/A |
±-----------------------------±-----------±--------±----------±---------------------±------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±----------±-----+
5 rows in set (0.80 sec)