Quantcast
Channel: alter table alter column causes huge log and data file growth - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Jonathan Fite for alter table alter column causes huge log and data file growth

$
0
0
  1. minimum storage for a VARCHAR is 4 bytes, I think, so you did change the size of the column from 1 byte to at least 4 bytes, causing (as you have observed) large amounts of data movement as the column grows and it shuffles other things around it.

  2. I would recommend Aaron's approach as a faster method to achieve the same end. The downside to it is that column order is not preserved.... but since we should always (lol) use named columns for our selects and inserts, the order of storage shouldn't matter. (may need to refresh frameworks....)

  3. You are correct. DDL is a logged transaction and thus the behavior you observed in your log file / AG health is to be expected.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>