REPLICA IDENTITY FULL logging whole rows
Note — this works and blocks nothing, but a performance regression is likely.
What it catches
REPLICA IDENTITY FULL writes the complete old row into WAL for every UPDATE and DELETE, and logical decoding must compare entire rows downstream. On write-heavy tables that is a permanent WAL and CPU tax; an index-based replica identity carries only the key.
Fires on
ALTER TABLE orders REPLICA IDENTITY FULL;Do this instead
Point the replica identity at a unique index (or keep the DEFAULT, which uses the primary key) so WAL carries only key columns for UPDATE/DELETE. Reserve FULL for tables that genuinely have no usable unique, non-partial, non-deferrable index — and treat that as the problem to fix.
SET lock_timeout = '5s';
ALTER TABLE orders REPLICA IDENTITY USING INDEX orders_pkey;
-- (with a primary key, REPLICA IDENTITY DEFAULT already does this) This rule runs in the hosted service on Startup and above — add --remote with a team token, or use the GitHub Action: npx bolvrk check migration.sql