Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: adjust N used in TopN cost formula based on the total number of rows #43285

Closed
qw4990 opened this issue Apr 21, 2023 · 0 comments · Fixed by #46368
Closed

planner: adjust N used in TopN cost formula based on the total number of rows #43285

qw4990 opened this issue Apr 21, 2023 · 0 comments · Fixed by #46368
Assignees

Comments

@qw4990
Copy link
Contributor

qw4990 commented Apr 21, 2023

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)

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                  |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.1.0-alpha-299-gee4fb2965d
Edition: Community
Git Commit Hash: ee4fb2965d07a6363711ee942d08d29e14bc1eb4
Git Branch: non-prep-debugx
UTC Build Time: 2023-04-20 09:10:06
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant