I'm in an unfortunate position of needing to add a unique, not null index to a very large table with heavy churn.
Withouthaving much impact, I can add a NULL column that reads default values from a sequence for new rows, and then do
batchupdates over time to fill in the old values.... but then I hit a big wall of locking when updating that column to
beNOT NULL.
If I were to make a partial index on my new, sequence-feed column where value is null (concurrently, of course), is
postgressmart enough to use that index when checking existing values for the ALTER command? Or even any index (I'll
haveto make a unique one eventually anyway).