Thursday, October 10, 2013

memory footprint of views

SELECT * FROM sys.views

select [name]
, type_desc
, space_used_in_kb = (page_count * 8.0)
, space_used_in_mb = (page_count * 8.0 / 1024.0)
from
    sys.indexes I inner join sys.dm_db_index_physical_stats(db_id(), object_id('.'), null, null, null) P on I.[object_id] = P.[object_id]
and I.[index_id] = P.[index_id]

Thursday, October 3, 2013

Create Date of SQL Server Index

select crdate, i.name, object_name(o.id)
from sysindexes i join sysobjects o ON o.id = i.id
where i.name IN ('ndx_move','ndx_2')
order by crdate desc