DC
Size: a a a
DC
DC
DC
DC
D
DC
Y@
D
DS
DS
AM
S
S
DS
DS
S
АФ
И
АФ
CREATE MATERIALIZED VIEW wproxy.traffic_uids_hourly
(
`rx` AggregateFunction(sum, UInt64),
`tx` AggregateFunction(sum, UInt64),
`uids` AggregateFunction(uniq, String),
`d` DateTime('Europe/Moscow'),
`clientId` String
)
ENGINE = AggregatingMergeTree()
ORDER BY (d, clientId)
SETTINGS index_granularity = 8192 AS
SELECT
sumState(rx) AS rx,
sumState(tx) AS tx,
uniqState(uuid) AS uids,
toStartOfHour(tm) AS d,
clientId
FROM wproxy.stats
GROUP BY
d,
clientId
И
CREATE MATERIALIZED VIEW wproxy.traffic_uids_hourly
(
`rx` AggregateFunction(sum, UInt64),
`tx` AggregateFunction(sum, UInt64),
`uids` AggregateFunction(uniq, String),
`d` DateTime('Europe/Moscow'),
`clientId` String
)
ENGINE = AggregatingMergeTree()
ORDER BY (d, clientId)
SETTINGS index_granularity = 8192 AS
SELECT
sumState(rx) AS rx,
sumState(tx) AS tx,
uniqState(uuid) AS uids,
toStartOfHour(tm) AS d,
clientId
FROM wproxy.stats
GROUP BY
d,
clientId