首页 > 代码库 > SQL Server 表压缩

SQL Server 表压缩

表压缩有三个选项

  1、page

  2、row

  3、none

-----------------------------------------------------------------------------------------------------------------------

三种设置方式:

  第一种:定义时指定

    create table table_name(....) 

    with

      (data_compression = none | page | row);

  第二种:修改时指定

    alter table table_name

    rebuild

    with

      (datacompression = page | row | none);

  第三种:针对特定分区

    create table table_name(...)

    on partition_schem_test(column_name)

    with

      (data_compression = page on partition(1 to 3),

       data_compression = row on partition(4));

    ---------------------------------------------------

    alter table table_name

    rebuild partition = 4

    with

      (data_compression = page);

 

SQL Server 表压缩