【TiDB 使用环境】生产环境
【TiDB 版本】4.0.13
【部署方式】机器部署
TIDB V4数据库这个SQL
Time: 2026-09-09T10:57:28.029732938+08:00
Txn_start_ts: 468955338532716757
User@Host: spam_user[spam_user] @ 10.43.129.189 [10.43.129.189]
Conn_ID: 4417689
Query_time: 0.389233557
Parse_time: 0.000074648
Compile_time: 0.000487895
Rewrite_time: 0.000101837
Optimize_time: 0.000231089
Wait_TS: 0.000008662
Cop_time: 0.388222849 Wait_time: 0.387 Request_count: 2 Total_keys: 3 Process_keys: 2
DB: tdb_spam_oltp
Index_names: [certification_sequence:uid_status_idx]
Is_internal: false
Digest: 69fdde7d69627e295995fca3ba984bb1af14bde9e0e80462e11fd00225b4f864
Stats: certification_sequence:468952193696006300
Num_cop_tasks: 2
Cop_proc_avg: 0 Cop_proc_p90: 0 Cop_proc_max: 0 Cop_proc_addr: 10.40.65.179:17114
Cop_wait_avg: 0.1935 Cop_wait_p90: 0.387 Cop_wait_max: 0.387 Cop_wait_addr: 10.40.65.179:17114
Mem_max: 38340
Prepared: false
Plan_from_cache: false
Plan_from_binding: false
Has_more_results: false
KV_total: 0.388144419
PD_total: 0.000007432
Backoff_total: 0
Write_sql_response_total: 0.000002535
Succ: true
Plan_digest: 23ad452d0f5e963489e55c2bfcd9d7f05269d5a9ac61f7927616fb194c0a9fd2
SELECT id,uid,auth_source,real_name,idcard,auth_status,reason_tx,reason_us,info_id,to_uid,order_id,time,datas,face_id,code,ip,idcard_encode,pic_secret_key,extra_data,pic_media,c
onstellation,real_name_encode FROM certification_sequence WHERE (uid = xxxxxxx AND auth_status IN (1)) ORDER BY time DESC;
| id | task | estRows | operator info | actRows | execution info | memory | disk | |
|---|---|---|---|---|---|---|---|---|
| Projection_4 | root | 2.07 | tdb_spam_oltp.certification_sequence.id, tdb_spam_oltp.certification_sequence.uid, tdb_spam_oltp.certification_sequence.auth_source, tdb_spam_oltp.certification_sequence.real_name, tdb_spam_oltp.certification_sequence.idcard, tdb_spam_oltp.certification_sequence.auth_status, tdb_spam_oltp.certification_sequence.reason_tx, tdb_spam_oltp.certification_sequence.reason_us, tdb_spam_oltp.certification_sequence.info_id, tdb_spam_oltp.certification_sequence.to_uid, tdb_spam_oltp.certification_sequence.order_id, tdb_spam_oltp.certification_sequence.time, tdb_spam_oltp.certification_sequence.datas, tdb_spam_oltp.certification_sequence.face_id, tdb_spam_oltp.certification_sequence.code, tdb_spam_oltp.certification_sequence.ip, tdb_spam_oltp.certification_sequence.idcard_encode, tdb_spam_oltp.certification_sequence.pic_secret_key, tdb_spam_oltp.certification_sequence.extra_data, tdb_spam_oltp.certification_sequence.pic_media, tdb_spam_oltp.certification_sequence.constellation, tdb_spam_oltp.certification_sequence.real_name_encode | 0 | time:483.5ms, loops:1, Concurrency:OFF | 9.81 KB | N/A | |
| └─IndexLookUp_13 | root | 2.07 | 0 | time:483.5ms, loops:1, table_task: {total_time: 1.93s, num: 0, concurrency: 4} | 220 Bytes | N/A | ||
| ├─IndexRangeScan_11 | cop[tikv] | 2.07 | table:certification_sequence, index:uid_status_idx(uid, auth_status), range:[1906684415983783937 1,1906684415983783937 1], keep order:false | 0 | time:483.4ms, loops:1, cop_task: {num: 1, max: 483.3ms, proc_keys: 0, rpc_num: 1, rpc_time: 483.3ms, copr_cache: disabled}, tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 0, total_keys: 1} | N/A | N/A | |
| └─TableRowIDScan_12 | cop[tikv] | 2.07 | table:certification_sequence, keep order:false | 0 | N/A | N/A | ||
| SQL执行计划很优,正常情况RPC_time在几毫秒左右,现在出现问题在几百毫秒。整个sql都慢在这里Cop_wait_p90: 0.387 | ||||||||
|  | |||||||
|  | |||||||
|  | |||||||
|  | |||||||
|  | |||||||
| 是什么原因导致的?该如何优化,请各位大佬帮帮忙 |