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

Refine building ranges logic #37176

Open
14 tasks done
xuyifangreeneyes opened this issue Aug 17, 2022 · 0 comments
Open
14 tasks done

Refine building ranges logic #37176

xuyifangreeneyes opened this issue Aug 17, 2022 · 0 comments
Assignees
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@xuyifangreeneyes
Copy link
Contributor

xuyifangreeneyes commented Aug 17, 2022

Enhancement

Currently the logic of building ranges has following problems:

  1. No memory control. We can construct the case like Query crashed the Tidb server #30755 to let TiDB OOM by building too many ranges.
  2. Building ranges is expensive. When there is a long IN list in query, it takes lots of CPU and generates lots of temporary small objects, which leads to frequency GC.
  3. The logic of building ranges is complex and not easy to read. Maybe we can refactor it step by step.

memory control for building ranges

reduce cost for building ranges

refactor for building ranges

@xuyifangreeneyes xuyifangreeneyes added the type/enhancement The issue or PR belongs to an enhancement. label Aug 17, 2022
@xuyifangreeneyes xuyifangreeneyes self-assigned this Aug 17, 2022
@xuyifangreeneyes xuyifangreeneyes added the sig/planner SIG: Planner label Aug 17, 2022
ti-chi-bot pushed a commit that referenced this issue Sep 9, 2022
ti-chi-bot pushed a commit that referenced this issue Sep 15, 2022
ti-chi-bot pushed a commit that referenced this issue Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant