planner: adjust N used in TopN cost formula based on the total number of rows #43285
Labels
affects-6.5
affects-7.1
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Currently, we use the formula
N*row-size*mem-factor
to estimate the memory cost of TopN, but actually,min(N, total_rows)*row-size*mem-factor
is better.2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: