暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GBase 8a在V95支持压缩算法和压缩等级的功能说明和使用样例

墨天轮DB 2022-04-29
292

GBase 8a从V95开始,支持多种压缩算法和压缩等级,下面是该功能的使用方法和样例。

压缩算法 gbase_compress_method

只读参数,只能通过配置文件,设置全局的压缩算法。

  • NoZip 无压缩
  • HighZ 高压缩比
  • RapidZ 快速压缩
  • STDZ 标准压缩

压缩等级 gbase_compress_level

取值0-9

  • 0=默认级别
  • 1=压缩比最低,压缩和解压缩速度最快
  • 9=压缩比最高,压缩和解压缩速度最慢

兼容说明

Compress(’NoZip‘,0)=compress(0,0) Compress(’HighZ’,0‘)=compress(1,3) Compress(’RapidZ‘,0‘)=compress(5,5) Compress(’STDZ’,0‘)=compress(’STDZ‘,3)

样例

表级

gbase> create table t6(id int) compress('STDZ',9); Query OK, 0 rows affected (Elapsed: 00:00:00.13) gbase> show create table t6; +-------+----------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------------------------------------------------------------------------+ | t6 | CREATE TABLE "t6" ( "id" int(11) DEFAULT NULL ) COMPRESS('STDZ', 9) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' | +-------+----------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (Elapsed: 00:00:00.00)

列级

gbase> create table t5(id int compress('STDZ',9)); Query OK, 0 rows affected (Elapsed: 00:00:00.11) gbase> show create table t5; +-------+----------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------------------------------------------------------------------------+ | t5 | CREATE TABLE "t5" ( "id" int(11) DEFAULT NULL COMPRESS('STDZ', 9) ) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' | +-------+----------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (Elapsed: 00:00:00.00)
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论