SQL SERVER 2012 COLUMNSTORE INDEX-之一(3)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-18 20:57 点击:次
order by total_size_mb desc
go
-- size per table
with segment_size_by_table AS (
SELECT
p.object_id as table_id,
SUM (css.on_disk_size)/1024/1024 AS segment_size_mb
FROM sys.partitions AS p
JOIN sys.column_store_segments AS css
ON p.hobt_id = css.hobt_id
group by p.object_id
) ,
dictionary_size_by_table AS (
SELECT
p.object_id AS table_id,
SUM (csd.on_disk_size)/1024/1024 AS dictionary_size_mb
FROM sys.partitions AS p
JOIN sys.column_store_dictionaries AS csd
ON p.hobt_id = csd.hobt_id
www.2cto.com
group by p.object_id
)
select
t.name AS table_name,
s.segment_size_mb,
d.dictionary_size_mb,
s.segment_size_mb + isnull(d.dictionary_size_mb, 0) as total_size_mb
from dictionary_size_by_table d
JOIN sys.tables AS t
ON t.object_id = d.table_id
left outer join segment_size_by_table s
on d.table_id = s.table_id
order by total_size_mb desc
go
-- size per column
www.2cto.com
with segment_size_by_column as (
SELECT
p.object_id as table_id,
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>