CREATE TABLE IF NOT EXISTS usage_events (
    timestamp    DateTime64(3) DEFAULT now64(3),
    username     LowCardinality(String),
    method       LowCardinality(String),
    path         String,
    normalized   LowCardinality(String),
    status_code  UInt16,
    duration_ms  UInt32,
    query_params String DEFAULT ''
)
ENGINE = MergeTree()
ORDER BY (username, timestamp)
TTL toDateTime(timestamp) + INTERVAL 90 DAY;
