【TiDB 使用环境】生产环境
一个tiflash节点,规格是 32c 64g 2t
在整体资源消耗极低的情况下(CPU 使用率1%都不到),执行计划出现了 tiflash_task:{time:5.89s, loops:80, threads:32}, tiflash_wait: {pipeline_queue_wait: 5820ms}。
tidb_max_tiflash_threads 使用的是默认值32
SELECT
COUNT(*) AS total
FROM
table_a tm
WHERE
(
tm.is_deleted = 0c
AND tm.c_name LIKE concat('%', '圣', '%')
AND tm.i_level IN ('N', 'H', 'A', 'B', 'C', 'O', 'D')
AND tm.fail_status IN (0)
)
AND (
tm.owner_id = ?
AND tm.first_level_status NOT IN (0, 1)
AND tm.created_org_id IN (?)
);
| id | estRows | estCost | actRows | task | access object | execution info | operator info
| StreamAgg_12 | 1.00 | 11060188.03 | 1 | root | | time:5.62s, loops:2 | funcs:count(1)->Column#99
| └─TableReader_52 | 3.67 | 11060005.12 | 1 | root | | time:5.62s, loops:2, cop_task: {num: 2, max: 0s, min: 0s, avg: 0s, p95: 0s, copr_cache_hit_ratio: 0.00} | MppVersion: 2, data:ExchangeSender_51
| └─ExchangeSender_51 | 3.67 | 165899225.58 | 1 | mpp[tiflash] | | tiflash_task:{time:5.62s, loops:1, threads:32}
| └─Selection_50 | 3.67 | 165899225.58 | 1 | mpp[tiflash] | | tiflash_task:{time:5.62s, loops:1, threads:32}
| └─TableFullScan_49 | 4417.35 | 136629106.38 | 4611 | mpp[tiflash] | table:tm | tiflash_task:{time:5.62s, loops:32, threads:32}, tiflash_wait: {pipeline_queue_wait: 5572ms}, tiflash_scan:{mvcc_input_rows:1710708, mvcc_input_bytes:29082036, mvcc_output_rows:1705959, lm_skip_rows:0, local_regions:8, remote_regions:0, tot_learner_read:4ms, region_balance:{instance_num: 1, max/min: 8/8=1.000000}, delta_rows:4537, delta_bytes:4388571, segments:5, stale_read_regions:0, tot_build_snapshot:0ms, tot_build_bitmap:79ms, tot_build_inputstream:81ms, min_local_stream:5601ms, max_local_stream:5602ms, dtfile:{data_scanned_rows:1697705, data_skipped_rows:44817, mvcc_scanned_rows:1706171, mvcc_skipped_rows:36351, lm_filter_scanned_rows:1742522, lm_filter_skipped_rows:0, tot_rs_index_check:0ms, tot_read:98ms}}