title: MDF file size much larger than actual data
body: <p>For some reason my MDF file is 154gigs, however, I only loaded 7 gigs worth of data from flat files.  Why is the MDF file so much larger than the actual source data?</p>
  
  <p>More info:</p>
  
  <p>Only a few tables with ~25 million rows.  No large varchar fields (biggest is 300, most are less than varchar(50).  Not very wide tables &lt; 20 columns.  Also, none of the large tables are indexed yet.  Tables with indexes have less than 1 million rows.  I don't use char, only varchar for strings. Datatype is not the issue.</p>
  
  <p>Turned out it was the log file, not the mdf file.  The MDF file is actually 24gigs which seems more reasonable, however still big IMHO.</p>
  
  <p>UPDATE:</p>
  
  <p>I fixed the problem with the LDF (log) file by changing the recovery model from FULL to simple.  This is okay because this server is only used for internal development and ETL processing.  In addition, before changing to SIMPLE I had to shrink the LOG file.  Shrinking is not recommended in most cases, however, this was one of those cases where the log file should have never grown so big and so fast.  For further reading see <a href="http://support.microsoft.com/kb/873235" rel="nofollow noreferrer">this</a></p>