coprocessor: do not ask unnecessary columns' info to avoid read values in TiKV if necessary #56004
Labels
component/executor
report/customer
Customers have encountered this bug.
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
The two select count(*) statement should have the similar process key size.
The t2 statement reads row value as well, so the total_process_keys_size is over hundred time of t1's.
Tikv determines whether to scan the value based on the columns_info in from the request. it will scan the value if it need any column from no-primary-key,related check is here:
https://github.com/tikv/tikv/blob/a4c0ea1657b3d939da51ea1cbbe77aff94bb60d3/components/tidb_query_executors/src/table_scan_executor.rs#L78-L83
Meanwhile, the column_info here comes from the request, the related proto are here:
https://github.com/pingcap/tipb/blob/e46e4632bd2b8c28a1a5f0986513bec8e25984e9/proto/executor.proto#L140-L154
The text was updated successfully, but these errors were encountered: