The rollup job recomputes only hours touched by events inserted since the last watermark, rebuilds a project after a privacy deletion, and drops hours past retention. Trends read rollups for whole hours and count the range edges and late events from pa.events, so answers stay exact. Adds the capacity runner for 1 000 000 generated events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 lines
242 B
SQL
4 lines
242 B
SQL
-- Rollups (A2): the rollup job finds the hours touched by newly inserted
|
|
-- events, and trends count the not-yet-rolled tail, through this index.
|
|
create index if not exists events_project_inserted_idx on pa.events (project_id, inserted_at);
|