mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
add test for reducing memory
This commit is contained in:
parent
12f6bf7b56
commit
25fbc79376
40
tests/queries/0_stateless/03270_window_memory_check.sql
Normal file
40
tests/queries/0_stateless/03270_window_memory_check.sql
Normal file
@ -0,0 +1,40 @@
|
||||
-- A test for #65647 that reduces the memory usage of some window functions.
|
||||
-- without the optimization, about 174 MiB is used.
|
||||
SELECT
|
||||
x,
|
||||
row_number() OVER (PARTITION BY x ORDER BY y ASC)
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
number % 1 AS x,
|
||||
number AS y
|
||||
FROM numbers(10000000)
|
||||
)
|
||||
FORMAT `null`
|
||||
SETTINGS max_threads = 1, max_memory_usage = 104857600;
|
||||
|
||||
SELECT
|
||||
x,
|
||||
rank() OVER (PARTITION BY x ORDER BY y ASC)
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
number % 1 AS x,
|
||||
number AS y
|
||||
FROM numbers(10000000)
|
||||
)
|
||||
FORMAT `null`
|
||||
SETTINGS max_threads = 1, max_memory_usage = 104857600;
|
||||
|
||||
SELECT
|
||||
x,
|
||||
dense_rank() OVER (PARTITION BY x ORDER BY y ASC)
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
number % 1 AS x,
|
||||
number AS y
|
||||
FROM numbers(10000000)
|
||||
)
|
||||
FORMAT `null`
|
||||
SETTINGS max_threads = 1, max_memory_usage = 104857600;
|
Loading…
Reference in New Issue
Block a user