• Sergiy (2/9/2016)


    Igor Micev (2/9/2016)


    Not so different from my approach. I make a column drop and rename, and you make a table drop and rename. The prepared dependencies goes for creation after within a transaction, all steps. In case of fail the table is still alive.

    Totally different.

    Whole world away.

    Altering a column changes every record in the table which is supposed to stay operational.

    Every data page and most of index pages get affected by "drop and rename column".

    Massive data change.

    And you need to do it within a transaction, so if anything goes wrong you can roll back to the original state.

    Which means - the table is not accessible for the whole duration of 0.5TB table being re-written.

    With my approach all the data get altered outside the transaction, by the asynchronous process which makes it ready when it's ready.

    Transaction only covers "last minute" data changes in the original table plus system catalogue alterations.

    Renaming a table does not change a single data page in it, so it usually gets done in no time.

    See the difference now?

    Correct.

    Igor Micev,My blog: www.igormicev.com