Skip to content

Instantly share code, notes, and snippets.

@kolobaev
Created February 1, 2022 14:45
Show Gist options
  • Save kolobaev/b0d40e57a53f7243b70fb1d4fb53d001 to your computer and use it in GitHub Desktop.
Save kolobaev/b0d40e57a53f7243b70fb1d4fb53d001 to your computer and use it in GitHub Desktop.
CREATE MATERIALIZED VIEW graphite.names
(
`Name` String,
`Date` Date
)
ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/replicator_common/graphite.names', '{replica}', Date)
PARTITION BY toYYYYMM(Date)
ORDER BY (Name, Date)
SETTINGS index_granularity = 8192 AS
SELECT DISTINCT
Name,
Date
FROM graphite.tagged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment