Comments on: Size Matters: Table Rows and Database Data Pages https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/ Thomas LaRock is an author, speaker, data expert, and SQLRockstar. He helps people connect, learn, and share. Along the way he solves data problems, too. Tue, 24 Mar 2020 20:33:59 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: When to Use Row or Page Compression in SQL Server - Thomas LaRock https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-73093 Tue, 24 Mar 2020 20:33:59 +0000 http://thomaslarock.com/?p=11360#comment-73093 […] I once wrote a post on how to find the objects in your database that store the fewest number of rows per page. It may be relevant for your interests here, too. Have a […]

]]>
By: ThomasLaRock https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-10922 Thu, 22 May 2014 13:38:00 +0000 http://thomaslarock.com/?p=11360#comment-10922 In reply to Ameena Lalani.

Well, you could inquire about how/why XML is being used. But unless you suspect performance problems as a result of the use of XML here, you aren’t likely to be able to change anything.

]]>
By: ThomasLaRock https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-10921 Thu, 22 May 2014 13:37:00 +0000 http://thomaslarock.com/?p=11360#comment-10921 In reply to Bill Barnes.

Thanks for the script Bill, I’ll see about testing it here locally when I have a chance.

]]>
By: Ameena Lalani https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-10908 Fri, 16 May 2014 13:56:00 +0000 http://thomaslarock.com/?p=11360#comment-10908 Glad to run across this script. One of my table has 2 rows per page. But then one of the column stored is XML. So I guess, I cannot do anything from this information?

]]>
By: (SFTW) SQL Server Links 16/05/14 • John Sansom https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-10906 Fri, 16 May 2014 09:32:23 +0000 http://thomaslarock.com/?p=11360#comment-10906 […] Size Matters: Table Rows And Database Data Pages – Thomas Larock (Blog|Twitter) […]

]]>
By: Size Matters: Table Rows and Database Data Pages - SQL Server - SQL Server - Toad World https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-10900 Tue, 13 May 2014 22:47:05 +0000 http://thomaslarock.com/?p=11360#comment-10900 […] Size Matters: Table Rows and Database Data Pages is a post from: SQLRockstar – Thomas LaRock […]

]]>
By: Bill Barnes https://thomaslarock.com/2014/05/size-matters-table-rows-and-database-data-pages/#comment-10886 Thu, 08 May 2014 04:21:00 +0000 http://thomaslarock.com/?p=11360#comment-10886 In reply to ThomasLaRock.

How about something like this? It won’t run as quick as yours and is even more of a “please don’t run in production” type of thing. I think it pulls most of the same data together. if you remove the comment out, it adds in a few useful fields. Do you see any consistency issues with this?

select sch.name as SchemaName, tbl.name as TableName, idx.name as IndexName,
ips.page_count as Pages, 1.0*record_count/page_count as Ratio , ips.record_count as RecordCount,
ips.avg_record_size_in_bytes, ips.max_record_size_in_bytes
–,ips.index_type_desc, ips.alloc_unit_type_desc, idx.fill_factor, fg.name as FileGroup, ips.partition_number, compressed_page_count
from sys.dm_db_index_physical_stats (db_id(),null,null,null,’detailed’) ips
inner join sys.indexes as idx on idx.object_id = ips.object_id
and idx.index_id = ips.index_id
inner join sys.tables as tbl on tbl.object_id = ips.object_id
inner join sys.schemas as sch on sch.schema_id = tbl.schema_id
inner join sys.filegroups as fg on fg.data_space_id = idx.data_space_id
where page_count > 0
and record_count > 1000
and index_level = 0

]]>