Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set showplan_text off
- set statistics io on
- go
- select top 10 *
- from customer
- where birthday = '1957-01-01'
- -- Parametry heap tabulky
- SELECT
- t.NAME AS TableName,
- p.rows AS RowCounts,
- SUM(a.total_pages) AS TotalBlocks,
- SUM(a.used_pages) AS UsedBlocks
- FROM sys.tables t
- INNER JOIN
- sys.indexes i ON t.OBJECT_ID = i.object_id
- INNER JOIN
- sys.partitions p ON i.object_id = p.OBJECT_ID AND
- i.index_id = p.index_id
- INNER JOIN
- sys.allocation_units a ON p.partition_id = a.container_id
- WHERE t.NAME = 'CUSTOMER'
- GROUP BY t.Name, p.Rows
- ORDER BY t.Name
- -- Indexy tabulky
- SELECT
- TableName = t.Name,
- i.*
- FROM
- sys.indexes i
- INNER JOIN
- sys.tables t ON t.object_id = i.object_id
- WHERE
- T.Name = 'Customer' and i.name is not null;
- -- Vyska B-stromu na tabulce
- SELECT INDEXPROPERTY(OBJECT_ID('Customer'),
- 'PK__Customer__D0587687D76E98AD', 'IndexDepth') - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement