For some reason, my MDF file is 154gigs, however I downloaded only 7 gigabytes of data from flat files. Why is the MDF file much larger than the actual source data?
Additional Information:
Only a few tables with ~ 25 million rows. There are no large varchar fields (the largest are 300, most of them smaller than varchar (50). Not very wide tables and 20 columns. In addition, none of the large tables are indexed. Tables with indexes have less than 1 million rows. ' t use char, only varchar for strings.Data type is not a problem.
It turned out to be a log file, not a mdf file. The MDF file is actually 24 gigs, which seems more reasonable, but still big IMHO.
UPDATE:
I fixed the problem with the LDF (log) file by changing the recovery model from FULL to simple. This is normal because this server is used only for internal ETL development and processing. In addition, before I switched to SIMPLE, I had to compress the LOG file. In most cases, shrinking is not recommended, but this was one of those cases where the log file has never become so large and fast. For further reading see this
source
share