Archive for July, 2010

MS Document on SQL Server Performance

Comments off

XSLT in XML Spy

Comments off

Alternatives to top command

Comments off

Perforce: Changing File Case

Comments off

Determining SQL Server Index Sizes

select
i.[object_id],
i.index_id,
p.partition_number,
p.rows as [#Records],
a.total_pages * 8 as [Reserved(kb)],
a.used_pages * 8 as [Used(kb)]
from
sys.indexes as i
inner join
sys.partitions as p
on i.object_id = p.object_id
and i.index_id = p.index_id
inner join
sys.allocation_units as a
on p.partition_id = a.container_id
where

 

i.[object_id] = object_id(‘dbo.order details’)
and i.index_id = 1 — clustered index

order by
p.partition_number
go

Notice the

 

 

red part above is where you put the DB table, and the index type is controlled by the second part. For a list of index Ids in SQL Server, please see: 

 

http://www.sql-server-performance.com/articles/per/index_data_structures_p1.aspx (run find with “Greater and equal to 2″)

Comments off