Skip to content

Commit 8f179b0

Browse files
authored
update slow query doc (pingcap#13411)
1 parent 9cf3aef commit 8f179b0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

identify-slow-queries.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ The following fields are related to transaction execution:
101101
* `Write_keys`: The count of keys that the transaction writes to the Write CF in TiKV.
102102
* `Write_size`: The total size of the keys or values to be written when the transaction commits.
103103
* `Prewrite_region`: The number of TiKV Regions involved in the first phase (prewrite) of the two-phase transaction commit. Each Region triggers a remote procedure call.
104+
* `Wait_prewrite_binlog_time`: The time used to write binlogs when a transaction is committed.
105+
* `Resolve_lock_time`: The time to resolve or wait for the lock to be expired after a lock is encountered during a transaction commit.
104106

105107
Memory usage fields:
106108

@@ -133,13 +135,32 @@ TiKV Coprocessor Task fields:
133135
* `Cop_wait_p90`: The P90 waiting time of cop-tasks.
134136
* `Cop_wait_max`: The maximum waiting time of cop-tasks.
135137
* `Cop_wait_addr`: The address of the cop-task whose waiting time is the longest.
138+
* `Rocksdb_delete_skipped_count`: The number of scans on deleted keys during RocksDB reads.
139+
* `Rocksdb_key_skipped_count`: The number of deleted (tombstone) keys that RocksDB encounters when scanning data.
140+
* `Rocksdb_block_cache_hit_count`: The number of times RocksDB reads data from the block cache.
141+
* `Rocksdb_block_read_count`: The number of times RocksDB reads data from the file system.
142+
* `Rocksdb_block_read_byte`: The amount of data RocksDB reads from the file system.
143+
* `Rocksdb_block_read_time`: The time RocksDB takes to read data from the file system.
136144
* `Cop_backoff_{backoff-type}_total_times`: The total times of backoff caused by an error.
137145
* `Cop_backoff_{backoff-type}_total_time`: The total time of backoff caused by an error.
138146
* `Cop_backoff_{backoff-type}_max_time`: The longest time of backoff caused by an error.
139147
* `Cop_backoff_{backoff-type}_max_addr`: The address of the cop-task that has the longest backoff time caused by an error.
140148
* `Cop_backoff_{backoff-type}_avg_time`: The average time of backoff caused by an error.
141149
* `Cop_backoff_{backoff-type}_p90_time`: The P90 percentile backoff time caused by an error.
142150

151+
`backoff-type` generally includes the following types:
152+
153+
* `tikvRPC`: The backoff caused by failing to send RPC requests to TiKV.
154+
* `tiflashRPC`: The backoff caused by failing to send RPC requests to TiFlash.
155+
* `pdRPC`: The backoff caused by failing to send RPC requests to PD.
156+
* `txnLock`: The backoff caused by lock conflicts.
157+
* `regionMiss`: The backoff caused by that processing requests fails when the TiDB Region cache information is outdated after Regions are split or merged.
158+
* `regionScheduling`: The backoff caused by that TiDB cannot process requests when Regions are being scheduled and the Leader is not selected.
159+
* `tikvServerBusy`: The backoff caused by that the TiKV load is too high to handle new requests.
160+
* `tiflashServerBusy`: The backoff caused by that the TiFlash load is too high to handle new requests.
161+
* `tikvDiskFull`: The backoff caused by that the TiKV disk is full.
162+
* `txnLockFast`: The backoff caused by that locks are encountered during data reads.
163+
143164
## Related system variables
144165

145166
* [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold): Sets the threshold for the slow log. The SQL statement whose execution time exceeds this threshold is recorded in the slow log. The default value is 300 (ms).

0 commit comments

Comments
 (0)