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.
Enhancement
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.