-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d8dba6
commit 8a6fe9d
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
ALTER TABLE events | ||
ENGINE = MergeTree() | ||
ORDER BY (ClusterName, EventTime) | ||
TTL EventTime + INTERVAL 30 DAY | ||
SETTINGS index_granularity = 8192; | ||
-- Change the engine to MergeTree | ||
ALTER TABLE events ENGINE = MergeTree(); | ||
|
||
-- Specify the new ORDER BY clause | ||
ALTER TABLE events ORDER BY ClusterName, EventTime; | ||
|
||
-- Set a TTL policy on the EventTime column | ||
ALTER TABLE events TTL EventTime + INTERVAL 30 DAY; | ||
|
||
-- Adjust the index granularity | ||
ALTER TABLE events SETTINGS index_granularity = 8192; |