mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
dbms: Server: feature development. [#METR-15090]
This commit is contained in:
parent
1ef3ae9dc4
commit
dd5584ea9a
@ -0,0 +1,43 @@
|
||||
100
|
||||
2014-06-01 10
|
||||
2014-06-02 10
|
||||
2014-06-03 10
|
||||
2014-06-04 10
|
||||
2014-06-05 10
|
||||
2014-06-06 10
|
||||
2014-06-07 10
|
||||
2014-06-08 10
|
||||
2014-06-09 10
|
||||
2014-06-10 10
|
||||
155
|
||||
2014-06-01 10
|
||||
2014-06-02 10
|
||||
2014-06-03 10
|
||||
2014-06-04 10
|
||||
2014-06-05 10
|
||||
2014-06-06 15
|
||||
2014-06-07 15
|
||||
2014-06-08 15
|
||||
2014-06-09 15
|
||||
2014-06-10 15
|
||||
2014-06-11 10
|
||||
2014-06-12 10
|
||||
2014-06-13 10
|
||||
2014-06-14 10
|
||||
2014-06-15 10
|
||||
155
|
||||
2014-06-01 10
|
||||
2014-06-02 10
|
||||
2014-06-03 10
|
||||
2014-06-04 10
|
||||
2014-06-05 10
|
||||
2014-06-06 15
|
||||
2014-06-07 15
|
||||
2014-06-08 15
|
||||
2014-06-09 15
|
||||
2014-06-10 15
|
||||
2014-06-11 10
|
||||
2014-06-12 10
|
||||
2014-06-13 10
|
||||
2014-06-14 10
|
||||
2014-06-15 10
|
@ -0,0 +1,47 @@
|
||||
SET min_bytes_to_use_direct_io = 128;
|
||||
|
||||
DROP TABLE IF EXISTS test.stored_aggregates;
|
||||
|
||||
CREATE TABLE test.stored_aggregates
|
||||
(
|
||||
d Date,
|
||||
Uniq AggregateFunction(uniq, UInt64)
|
||||
)
|
||||
ENGINE = AggregatingMergeTree(d, d, 8192);
|
||||
|
||||
INSERT INTO test.stored_aggregates
|
||||
SELECT
|
||||
toDate(toUInt16(toDate('2014-06-01')) + intDiv(number, 100)) AS d,
|
||||
uniqState(intDiv(number, 10)) AS Uniq
|
||||
FROM
|
||||
(
|
||||
SELECT * FROM system.numbers LIMIT 1000
|
||||
)
|
||||
GROUP BY d;
|
||||
|
||||
SELECT uniqMerge(Uniq) FROM test.stored_aggregates;
|
||||
|
||||
SELECT d, uniqMerge(Uniq) FROM test.stored_aggregates GROUP BY d ORDER BY d;
|
||||
|
||||
INSERT INTO test.stored_aggregates
|
||||
SELECT
|
||||
toDate(toUInt16(toDate('2014-06-01')) + intDiv(number, 100)) AS d,
|
||||
uniqState(intDiv(number + 50, 10)) AS Uniq
|
||||
FROM
|
||||
(
|
||||
SELECT * FROM system.numbers LIMIT 500, 1000
|
||||
)
|
||||
GROUP BY d;
|
||||
|
||||
SELECT uniqMerge(Uniq) FROM test.stored_aggregates;
|
||||
|
||||
SELECT d, uniqMerge(Uniq) FROM test.stored_aggregates GROUP BY d ORDER BY d;
|
||||
|
||||
OPTIMIZE TABLE test.stored_aggregates;
|
||||
|
||||
SELECT uniqMerge(Uniq) FROM test.stored_aggregates;
|
||||
|
||||
SELECT d, uniqMerge(Uniq) FROM test.stored_aggregates GROUP BY d ORDER BY d;
|
||||
|
||||
DROP TABLE test.stored_aggregates;
|
||||
|
Loading…
Reference in New Issue
Block a user