列ストアインデックスのメタ情報を取るクエリのメモ

幾つかメモ。

行グループ

select 
  object_name(object_id) as table_name
  , * 
from 
  sys.column_store_row_groups
where 
  OBJECT_NAME(object_id) = 'table_name'

sys.column_store_row_groups (Transact-SQL)

列セグメント

select
  object_name(p.object_id) as table_name
  , c.name as column_name
  , css.*
from
  sys.column_store_segments css
  left join sys.partitions p on p.hobt_id = css.hobt_id and p.partition_id = css.partition_id
  left join sys.indexes ind on p.index_id = ind.index_id and p.object_id = ind.object_id
  left join sys.index_columns indc on indc.object_id = ind.object_id and indc.index_id = ind.index_id and indc.index_column_id = css.column_id
  left join sys.columns c on c.column_id = indc.column_id and c.object_id = p.object_id
where
  object_name(p.object_id) = 'table_name'

sys.column_store_segments (Transact-SQL)

デルタストア、削除済ビットマップ、削除バッファーとか

select 
  object_name(object_id) as table_name 
  , * 
from sys.internal_partitions
where
  object_name(object_id) = 'table_name'

sys.internal_partitions (TRANSACT-SQL)