pingcap / pingcap/tidb

`rows per task` of IndexLookUp is hardcoded

Open
#58,880 0 comments 0 reactions 0 assignees View on GitHub
sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

![Image](https://github.com/user-attachments/assets/aa07e7d3-e46a-4a93-b9ed-67b1b996cfcc)
As we can see, the `batchSize` is a const(default is 20000) and the `taskPerBatch` is 32.
This indicates that each task is expected to scan 625 rows.

It's a hardcoded value to lead to a suboptimal execution plan. (we may think that the number of tasks is too large and decide not to choose index scan. but one task may scan 10000 rows).
We need to consider the data distribution and calculate it more correctly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.