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

Optimizer costing mode to reduce memory use #81920

Open
msirek opened this issue May 26, 2022 · 0 comments
Open

Optimizer costing mode to reduce memory use #81920

msirek opened this issue May 26, 2022 · 0 comments
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) sync-me sync-me-5 T-sql-queries SQL Queries Team
Projects

Comments

@msirek
Copy link
Contributor

msirek commented May 26, 2022

Is your feature request related to a problem? Please describe.
When queries with multiple joins and aggregations are run simultaneously, the combined memory use of all queries exceeds the amount of available memory, resulting in memory budget exceeded errors.

Describe the solution you'd like
Provide a query optimizer mode (perhaps via a cluster setting or session variable) where queries are optimized not for runtime, but for memory use. Optionally this could be a weighting, where for example, we attribute 50% of the query cost to CPU and 50% to memory, or any adjustable ratio.

Describe alternatives you've considered
When deciding join order, optimize for relation size or cardinality (though selection of individual joins is still optimized based on CPU cost). Keeping relation size low throughout the plan will have a side effect of reduced memory usage.

Additional context
None

Jira issue: CRDB-16451

@msirek msirek added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team labels May 26, 2022
@msirek msirek self-assigned this May 26, 2022
@msirek msirek added this to Triage in SQL Queries via automation May 26, 2022
@mgartner mgartner moved this from Triage to Backlog in SQL Queries May 31, 2022
@mari-crl mari-crl added sync-me and removed sync-me labels Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) sync-me sync-me-5 T-sql-queries SQL Queries Team
Projects
Status: Backlog
SQL Queries
Backlog (DO NOT ADD NEW ISSUES)
Development

No branches or pull requests

3 participants