I would say that if compiler.operatormemory is set than that should
probably get priority.
I would also say that the most important cases are the two (RBO and CBO)
when the user says nothing - as most users will not be manually setting
memory (as they wouldn't really know how, and queries coming from BI
tools will never have a chance to do that).
I wonder if we'll wish for a way to have a maximum operator memory limit
that could be set as a config parameter, to keep the CBO approach from
exceeding that? (I guess this is a suggestion for one of the things
that might be a useful parameter of the upcoming CBO memory manager.)
On 4/13/25 9:57 PM, Gaurav Vaghasiya wrote:
Updated, as my formatted table is not showing up as intended.
t
Case 1:- `compiler.cbo` is false OR stats not available
- No `compiler.operatormemory` in query → Use memory from cc.conf
- `compiler.operatormemory` set → Use user-defined memory
Case 2:- `compiler.cbo` is true AND stats available
- No `compiler.operatormemory` → Use memory from CBO stats
- `compiler.operatormemory` set → *Choose one:*
- Use CBO-based memory
- OR Use user-defined memory
On Sun, Apr 13, 2025 at 5:50 PM Gaurav Vaghasiya<gvaghasiy...@gmail.com>
wrote:
Hi,
I am working on the CBO-based memory manager,
Overall, the idea is to based on stats provided by CBO(Cost based
Optimizer) to assign better memory to memory Intensive operators(JOIN,
ORDER, WINDOW, GROUP BY), instead of using the memory defined cc.conf.
Now, with that there are some design choices I need to make. So do let me
know the opinions or any improvement or any case I am missing and plus I am
not sure about the last case(underlined one).
*| Which Memory to Use? |
Query does NOT contain `compiler.operatormemory` | Query contains
`compiler.operatormemory` *|
|-------------------------------------------------------------------------|------------------------------------------------------------------------------|------------------------------------------------------------------|
| `compiler.cbo` is false OR `compiler.cbo` is true, |
|
|
| but stats are NOT available |
Use the memory defined in `cc.conf` | Use
the memory defined by the user in the query |
|-------------------------------------------------------------------------|------------------------------------------------------------------------------|------------------------------------------------------------------|
| `compiler.cbo` is true, and stats are available | Use
memory based on CBO Stats |* What
option to choose? Use CBO-based memory |*
| *OR User-defined memory?*
|
Thanks,
Gaurav