add projection code

This commit is contained in:
Francis Cao 2024-08-01 15:34:35 -07:00
parent 9882ff24f6
commit 61dfa1391e

View File

@ -170,4 +170,19 @@ GROUP BY website_id,
subdivision1, subdivision1,
city, city,
event_type, event_type,
timestamp); timestamp);
-- projections
ALTER TABLE umami.website_event
ADD PROJECTION website_event_url_path_projection (
SELECT * ORDER BY toStartOfDay(created_at), website_id, url_path, created_at
);
ALTER TABLE umami.website_event MATERIALIZE PROJECTION website_event_url_path_projection;
ALTER TABLE umami.website_event
ADD PROJECTION website_event_referrer_domain_projection (
SELECT * ORDER BY toStartOfDay(created_at), website_id, referrer_domain, created_at
);
ALTER TABLE umami.website_event MATERIALIZE PROJECTION website_event_referrer_domain_projection;