Search Postgresql Archives

speeding up ALTER ... SET NOT NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm in an unfortunate position of needing to add a unique, not null index to a very large table with heavy churn. Without having much impact, I can add a NULL column that reads default values from a sequence for new rows, and then do batch updates over time to fill in the old values.... but then I hit a big wall of locking when updating that column to be NOT NULL. 

If I were to make a partial index on my new, sequence-feed column where value is null (concurrently, of course), is postgres smart enough to use that index when checking existing values for the ALTER command? Or even any index (I'll have to make a unique one eventually anyway).

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux