2024-01-15 16:13:32 +00:00
|
|
|
|
|
|
|
{% for engine in ['Memory', 'Log', 'TinyLog', 'MergeTree ORDER BY (a) SETTINGS min_bytes_for_wide_part = 0, min_rows_for_wide_part = 2000'] -%}
|
|
|
|
|
|
|
|
SELECT '--- {{ engine }} ---';
|
|
|
|
|
2024-01-11 21:55:22 +00:00
|
|
|
DROP TABLE IF EXISTS t_nested_offsets;
|
|
|
|
|
|
|
|
CREATE TABLE t_nested_offsets
|
|
|
|
(
|
|
|
|
`a` String,
|
|
|
|
`e.n` Array(String),
|
|
|
|
`e.t` Array(Int64)
|
|
|
|
)
|
2024-01-15 16:13:32 +00:00
|
|
|
ENGINE = Log;
|
2024-01-11 21:55:22 +00:00
|
|
|
|
2024-01-15 16:13:32 +00:00
|
|
|
SYSTEM STOP MERGES t_nested_offsets;
|
2024-01-11 21:55:22 +00:00
|
|
|
|
|
|
|
INSERT INTO t_nested_offsets SELECT number, range(number % 10), range(number % 10) FROM numbers(1000);
|
|
|
|
|
|
|
|
SELECT sum(e.n.size0) FROM t_nested_offsets;
|
|
|
|
SELECT sum(e.n.size0), sum(e.t.size0) FROM t_nested_offsets;
|
|
|
|
|
|
|
|
SELECT sum(length(e.n)) FROM t_nested_offsets SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
SELECT sum(length(e.n)), sum(length(e.t)) FROM t_nested_offsets SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
|
|
|
|
INSERT INTO t_nested_offsets SELECT number, range(number % 10), range(number % 10) FROM numbers(20000);
|
|
|
|
|
|
|
|
SELECT sum(e.n.size0) FROM t_nested_offsets;
|
|
|
|
SELECT sum(e.n.size0), sum(e.t.size0) FROM t_nested_offsets;
|
|
|
|
|
|
|
|
SELECT sum(length(e.n)) FROM t_nested_offsets SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
SELECT sum(length(e.n)), sum(length(e.t)) FROM t_nested_offsets SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
|
|
|
|
DROP TABLE t_nested_offsets;
|
2024-01-15 16:13:32 +00:00
|
|
|
|
|
|
|
{% endfor -%}
|