pingcap / pingcap/tidb

the chunk size control can be more elegant

Open
#50,344 4 comments 0 reactions 0 assignees View on GitHub
report/customer sig/execution type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
![image](https://github.com/pingcap/tidb/assets/7846227/c60c0928-1774-4da4-a4ef-db888a7963b1)
From this explain result, we can see that there's LIMIT which only needs 10 rows.
And, yes, the `10` is propagated to the below selection as we can see that it also only reads 10 rows.

But, the `10` is not propagated anymore and the below APPLY uses the default chunk size of 1024. The execution time has increased significantly. And if we set the `@@tidb_max_chunk_size` to 100, the execution time can be reduced to 300ms.

We may need a more well-maintained chunk size control.

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.