You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Complex query causes high memory consumption ignoring limits #61238
Well, our analysts made up a query that causes high memory consumption which ends with OOM. The worst part is that Clickhouse is ignoring max_server_memory_usage parameter and consumes all available memory making our server freeze.
Does it reproduce on the most recent release?
Yes, reproducible on 24.2.1.2248
How to reproduce
I simplified the query as much as I could using only built-in tables.
WITH (SELECTnumberFROMsystem.numbersLIMIT1) as w1,
(SELECTnumberFROMsystem.numbersLIMIT1) as w2,
(SELECTnumberFROMsystem.numbersLIMIT1) as w3,
(SELECTnumberFROMsystem.numbersLIMIT1) as w4,
(SELECTnumberFROMsystem.numbersLIMIT1) as w5,
(SELECTnumberFROMsystem.numbersLIMIT1) as w6
SELECTnumberFROM (
SELECTnumberFROMsystem.numbersLIMIT10UNION ALLSELECTnumberFROMsystem.numbersLIMIT10
)
WHEREnumber<5
Expected behavior
Throw exception: MEMORY_LIMIT_EXCEEDED or AST_IS_TOO_BIG or complete the query successfully without exceeding memory limit.
Additional context
Log while executing the query above. I killed container with Ctrl+C. crash.log
Activity
UnamedRus commentedon Mar 12, 2024
Related #53752
nikitamikhaylov commentedon Apr 3, 2024
It works with a new Analyzer on
24.3andhead. I will add this example as a test case here: #62185