views:

551

answers:

2
  • I created a protected folder on my ASP.NET site with the "ASP.NET Configuration" tool.
  • It made a database called App_Data/ASPNETDB.MDF where it stores one (1) user.
  • While uploading I noticed now that the database has grown to 10 MB and the .ldf file is 5 MB. (!)
  • I tried to look at it with SQL Server 2008 Management Studio but when attaching it said "Failed to retrieve data for this request."

Has this ASPNETDB.MDF bloat every happened to anyone else?

A: 

I think this is just the default size for the aspnetdb, at least in sql 2005 express all my aspnetdb databases are 10mb initially

TT
Wow, that's a lot of overhead. A 1K SQLite file could provide the same functionality.
Edward Tanguay
+2  A: 

The size of the database is really irrelevant. There may only be 1-2KB worth of data in the file, but when SQL Server creates the database files, it doesn't know how much data you intent to put in them, so it adds some extra space. This way, when you do add more data (as most users do), it will all be contiguous, and the SQL Server won't have to delay application execution while it continually expands the file. When you create the database, you can specify a smaller size - perhaps you should drop and recreate it as a 1MB DB instead.

If you'd like to check for sure, this article has a script for getting the size of every object in a database, and you can see if there's a particular offending object, but my guess is that they'll all be small and the rest will be empty space.

rwmnau