mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
template multiple queries for filtering
This commit is contained in:
parent
3494ae46b7
commit
cb4368e12c
4 changed files with 66 additions and 14 deletions
|
|
@ -30,7 +30,9 @@ CREATE TABLE umami.website_event
|
|||
job_id Nullable(UUID)
|
||||
)
|
||||
engine = MergeTree
|
||||
ORDER BY (website_id, session_id, created_at)
|
||||
PARTITION BY toYYYYMM(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)
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
||||
CREATE TABLE umami.event_data
|
||||
|
|
@ -97,15 +99,9 @@ CREATE TABLE umami.website_event_stats_hourly
|
|||
created_at Datetime('UTC')
|
||||
)
|
||||
ENGINE = AggregatingMergeTree
|
||||
PARTITION BY toYYYYMM(created_at)
|
||||
ORDER BY (
|
||||
website_id,
|
||||
event_type,
|
||||
toStartOfHour(created_at),
|
||||
cityHash64(visit_id),
|
||||
visit_id
|
||||
)
|
||||
SAMPLE BY cityHash64(visit_id);
|
||||
PARTITION BY toYYYYMM(created_at)
|
||||
ORDER BY (toStartOfDay(created_at), website_id, session_id, visit_id, created_at)
|
||||
PRIMARY KEY (toStartOfDay(created_at), website_id, session_id, visit_id)
|
||||
|
||||
CREATE MATERIALIZED VIEW umami.website_event_stats_hourly_mv
|
||||
TO umami.website_event_stats_hourly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue