The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,115 other followers

Archive for November 22nd, 2012

SQL Server quick tip by Denis Gobo: use DBCC SHOWCONTIG for Min/Max/Average row sizes (via: sql server – Size of a single Record ? SQL – Stack Overflow)

Posted by jpluimers on 2012/11/22

Thanks SQLMenace (Denis Gobo) for this great tip on getting min/max/average row sizes (and more) using DBCC SHOWCONTIG.

Don’t forget the “with tableresults”, without it, it will skip the min/max/average recordsize from the results, and present the results as text (not as a row).

 

 

Run DBCC SHOWCONTIG with your table name

dbcc showcontig ('TableName') with tableresults

then look at max min and average record size

This feature works at least from SQL Server 2000 onward, though somewhere after SQL Server 2012 it will be removed.
As of SQL Server 2005 you can use sys.dm_db_index_physical_stats. An example on how to use that is here.

It just made me shiver when finding out an unindexed table with 9 million rows averaging about 300 bytes took 8 minutes to query.
Time to add some indexes, and have someone look at the disk back-end.

–jeroen

via: sql server – Size of a single Record ? SQL – Stack Overflow.

Posted in Database Development, Development, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012 | Leave a Comment »

 
%d bloggers like this: