mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
revert AggregatingMergeTree order by
This commit is contained in:
parent
57a23bab2d
commit
3207b0ce06
@ -29,11 +29,11 @@ CREATE TABLE umami.website_event
|
|||||||
created_at DateTime('UTC'),
|
created_at DateTime('UTC'),
|
||||||
job_id Nullable(UUID)
|
job_id Nullable(UUID)
|
||||||
)
|
)
|
||||||
engine = MergeTree
|
ENGINE = MergeTree
|
||||||
PARTITION BY toYYYYMM(created_at)
|
PARTITION BY toYYYYMM(created_at)
|
||||||
ORDER BY (toStartOfHour(created_at), website_id, session_id, visit_id, created_at)
|
ORDER BY (toStartOfHour(created_at), website_id, session_id, visit_id, created_at)
|
||||||
PRIMARY KEY (toStartOfHour(created_at), website_id, session_id, visit_id)
|
PRIMARY KEY (toStartOfHour(created_at), website_id, session_id, visit_id)
|
||||||
SETTINGS index_granularity = 8192;
|
SETTINGS index_granularity = 8192;
|
||||||
|
|
||||||
CREATE TABLE umami.event_data
|
CREATE TABLE umami.event_data
|
||||||
(
|
(
|
||||||
@ -50,9 +50,9 @@ CREATE TABLE umami.event_data
|
|||||||
created_at DateTime('UTC'),
|
created_at DateTime('UTC'),
|
||||||
job_id Nullable(UUID)
|
job_id Nullable(UUID)
|
||||||
)
|
)
|
||||||
engine = MergeTree
|
ENGINE = MergeTree
|
||||||
ORDER BY (website_id, event_id, data_key, created_at)
|
ORDER BY (website_id, event_id, data_key, created_at)
|
||||||
SETTINGS index_granularity = 8192;
|
SETTINGS index_granularity = 8192;
|
||||||
|
|
||||||
CREATE TABLE umami.session_data
|
CREATE TABLE umami.session_data
|
||||||
(
|
(
|
||||||
@ -66,9 +66,9 @@ CREATE TABLE umami.session_data
|
|||||||
created_at DateTime('UTC'),
|
created_at DateTime('UTC'),
|
||||||
job_id Nullable(UUID)
|
job_id Nullable(UUID)
|
||||||
)
|
)
|
||||||
engine = MergeTree
|
ENGINE = MergeTree
|
||||||
ORDER BY (website_id, session_id, data_key, created_at)
|
ORDER BY (website_id, session_id, data_key, created_at)
|
||||||
SETTINGS index_granularity = 8192;
|
SETTINGS index_granularity = 8192;
|
||||||
|
|
||||||
-- stats hourly
|
-- stats hourly
|
||||||
CREATE TABLE umami.website_event_stats_hourly
|
CREATE TABLE umami.website_event_stats_hourly
|
||||||
@ -99,8 +99,15 @@ CREATE TABLE umami.website_event_stats_hourly
|
|||||||
created_at Datetime('UTC')
|
created_at Datetime('UTC')
|
||||||
)
|
)
|
||||||
ENGINE = AggregatingMergeTree
|
ENGINE = AggregatingMergeTree
|
||||||
PARTITION BY toYYYYMM(created_at)
|
PARTITION BY toYYYYMM(created_at)
|
||||||
ORDER BY (toStartOfDay(created_at), website_id, session_id, visit_id, created_at)
|
ORDER BY (
|
||||||
|
website_id,
|
||||||
|
event_type,
|
||||||
|
toStartOfHour(created_at),
|
||||||
|
cityHash64(visit_id),
|
||||||
|
visit_id
|
||||||
|
)
|
||||||
|
SAMPLE BY cityHash64(visit_id);
|
||||||
|
|
||||||
CREATE MATERIALIZED VIEW umami.website_event_stats_hourly_mv
|
CREATE MATERIALIZED VIEW umami.website_event_stats_hourly_mv
|
||||||
TO umami.website_event_stats_hourly
|
TO umami.website_event_stats_hourly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user