Why did my App_Data / ASPNETDB.MDF grow to 10MB?

  • I created a secure folder in my ASP.NET site using the ASP.NET Setup tool.
  • He created a database called App_Data / ASPNETDB.MDF where one (1) user is stored.
  • While loading, I noticed that the database grew to 10MB and the .ldf file grew to 5MB. (!)
  • I tried to look at it using SQL Server 2008 Management Studio, but when connected, it said "Failed to get data for this query."

Did this ASPNETDB.MDF bloat happen to someone else?

0


source to share


2 answers


The size of the database doesn't really matter. There can only be 1-2KB data in the file, but when SQL Server creates the database files it doesn't know how much data you intend to insert into them, so it adds extra space. This way, when you add more data (as most users do), everything will be contiguous, and SQL Server will not require application execution latency while it constantly expands the file. When you create the database, you can specify a smaller size - perhaps you should reset and recreate it as 1 MB. Instead of this.



If you want to check for sure, this article has a script to get the size of each object in the database and you can see if there is any particular offensive object, but I assume they will all be small and the rest will be empty.

+2


source


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



0


source







All Articles