mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 20:42:04 +00:00
33 lines
721 B
SQL
33 lines
721 B
SQL
-- Tags: no-random-merge-tree-settings
|
|
|
|
DROP TABLE IF EXISTS t0;
|
|
|
|
CREATE TABLE t0
|
|
(
|
|
c1 Int64,
|
|
c2 Int64,
|
|
c3 Int64,
|
|
PROJECTION p1
|
|
(
|
|
SELECT
|
|
c1,
|
|
c2,
|
|
sum(c3)
|
|
GROUP BY
|
|
c2,
|
|
c1
|
|
)
|
|
)
|
|
ENGINE = MergeTree ORDER BY (c1, c2) settings min_bytes_for_wide_part = 10485760, min_rows_for_wide_part = 0;
|
|
|
|
INSERT INTO t0 SELECT
|
|
number,
|
|
-number,
|
|
number
|
|
FROM numbers_mt(1e5);
|
|
|
|
select * from (EXPLAIN indexes = 1 SELECT c1, sum(c3) FROM t0 GROUP BY c1) where explain like '%ReadFromMergeTree%';
|
|
select * from (EXPLAIN indexes = 1 SELECT c1, sum(c3) FROM t0 WHERE c1 = 100 GROUP BY c1) where explain like '%Granules%';
|
|
|
|
DROP TABLE t0;
|