-- 테스트 데이터 생성

--drop table t1
create table t1 (col1 int, col2 varchar(max))

insert into t1 with(tablock)
select top 10000 ROW_NUMBER() over (order by (select 1)) col1, replicate(convert(varchar(max), 'abcdefghijklmnopqrstuvwxyz'), 1000) col2
from sysindexes a, sysindexes a1, sysindexes a2

sp_spaceused t1
t1 10000                275152 KB 275072 KB 8 KB 72 KB

create clustered index cl_t1 on t1 (col1) with(data_compression = page)
sp_spaceused t1
t1 10000                275536 KB 275072 KB 80 KB 384 KB

 

-- > 페이지 압축을 통해서는 압축이 거의 되지 않음 (data_compression = row 압축도 동일함)

 

 

drop index t1.cl_t1
sp_spaceused t1
t1 10000                275472 KB 275072 KB 72 KB 328 KB

create clustered columnstore index cci_t1 on t1
sp_spaceused t1
t1 10000                4104 KB 4032 KB 0 KB 72 KB

 

-- > CCI로는 압축이 됨

 

 

AND