all groups > sql server msde > december 2006 >
You're in the

sql server msde

group:

MDF size way too large



MDF size way too large Lucvdv
12/22/2006 12:00:00 AM
sql server msde: I've got a SQL Express database with, right after running DBCC
SHRINKDATABASE, an MDF file size of 1.59 GB. The log file size is
neglectable, less than 1 MB.

The database properties say size 1632.50 MB, 159.07 MB available.

When I look at the properties of all tables individually and add their data
and index sizes, they add up to 590 MB.

What's it using the other 1GB for?
Re: MDF size way too large Lucvdv
12/22/2006 12:00:00 AM
[quoted text, click to view]

To find out if it could have anything to do with data fragmentation, I
backed up that database and restored it under another name, to new mdf and
ldf files.

No difference: the new version is also 1.59 GB.



I also checked an identical setup at another customer.

The database is 547 MB large there, while all tables (data + indexes) add
up to 391 MB.
Re: MDF size way too large Roger Wolter[MSFT]
12/22/2006 10:24:44 AM
Backup back up the database pages and restores the to the exact location in
the file that they were backed up from so a backup and restore leaves the
database with exactly the same amount of fragmentation it had before.
Rebuilding the indexes and then shrinking the file will probably get the
size down but why bother? The going rate for disk space is maybe $.50 to
$1.00 a GB so how much effort are you willing to go through to save a buck?

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

[quoted text, click to view]

Re: MDF size way too large Andrea Montanari
12/22/2006 4:59:15 PM
hi,
[quoted text, click to view]

actually it can be related with fragmentation.. have a look at
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx
for some hints about it.. it's based on SQL Server 2000 storage engine but
2005 implications are relevant...
just have a look at http://msdn2.microsoft.com/en-gb/library/ms188917.aspx
for info about sys.dm_db_index_physical_stats instead of DBCC commands...

[quoted text, click to view]

again, chances the difference is about fragmentation, as long as fillfactor
settings and average row size that have to fit the 8060bytes boundary...
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.20.0 - DbaMgr ver 0.64.0 and further SQL Tools
--------- remove DMO to reply

AddThis Social Bookmark Button