Optimizer costing mode to reduce memory use #81920
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
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
The text was updated successfully, but these errors were encountered: