SQL SERVER, Database file size and Log file size

Why is the data execution so slow? Many ask this question when they discover that the online data execution is very slow, irrespective of a good internet speed. The answer to this question sometimes lays in the size of the database and its log file in particular.

The below query will show a brief detail about the database.

sp_helpdb 'your-database-name'

The size of the log file sometimes determines the performance of a database and if you have been allocated limited space for hosting a database driven website, then you must be very careful while managing your database.

Remember

Log files consume lot of space when you perform bulk inserts, updates or deletes. Depending upon the size of your sql command, the log file will consume the spaces allocated to you. So it’s always good if you can avoid using bulk updates on your database.

There is another script with which you can check the database properties. Run the below script on the local database.

SELECT database_id, DB_NAME(database_id) DatabaseName, 
    Name AS FileName, 
	physical_name AS FilePath, 
	(size*8)/1024.0 AS [FileSize (MB)]
FROM sys.master_files
WHERE DB_NAME(database_id) = 'your-database-name'

Note: Your service provider may not give you the permission to view the sys.master_files.

A Final Word

Before submitting and hosting a database driven website, plan your database properly to make sure it does not trouble you in the future.

Related Posts:

Like this Article? Subscribe now, and get all the latest articles and tips, right in your inbox.

Enter your email id

Delivered by FeedBurner
Tweet this article Facebook Google+
comments powered by Disqus

Join our Google Plus Community and be a part of a discussion!