返回首页

gbase数据、南大通用产品文档:GBase8s清除压缩字典参数:移除压缩字典(SQL 管理 API)

更新日期:2024年09月11日

调用带有 compression purge_dictionary 初始命令的 admin() 或 task() 函数来删除所有不
活动的压缩字典,或删除在指定的日期之前为压缩的表或分片创建的所有不活动的压缩字
典。在您删除为该表和分区创建的任何压缩字典之前,必须解压缩表和分片。
语法:

用法
在对表和分片执行 purge_dictionary 操作之前,您必须:
 解压缩表和分片。
当您解压缩表或分片时, GBase 8s 标记该表或分片的字典为不活动的。
 请确保 Enterprise Replication 函数不需要该压缩字典。
 归档包含带有压缩字典的表或分片的任何 dbspace,即使您已经解压缩该表或分片
中的数据,且该字典不再是活动的。
compression purge_dictionary 命令删除所有压缩字典。

GBase 8s 管理员参考
南大通用数据技术股份有限公司 - 828 -
带有日期作为第二个参数的 compression purge_dictionary 命令删除在指定的日期之前以及
那一天创建的所有压缩字典。
您可根据您的语言环境和环境使用可转换到 DATE 日期格式
的任何格式的日期。例如,您可指定 03/29/2009、03/29/09 或 Mar 29, 2009。
您还可通过调用以 table 或 fragment 为初始命令,且以 purge_dictionary 为下一个参数的
admin() 或 task() 命令,删除特定的压缩字典。
您不可删除为索引创建的压缩字典。当删除这些索引时,数据库服务器移除这些压缩字典。

下列命令告诉 GBase 8s 移除在 2009 年 7 月 8 日之前和那一天创建的所有字典:
EXECUTE FUNCTION task("compression purge_dictionary", "07/08/2009");
下列命令告诉 GBase 8s 移除 insurance 数据库中名为 auto 的表的不活动字典,该数据库
的所有者为 tjones。
EXECUTE FUNCTION task("table purge_dictionary",
"auto", "insurance", "tjones");

USER()
函数说明
返回当前的GBase 8a MPP Cluster 用户和主机名。
示例
示例1:当前的用户为“root”,主机名为“172.168.83.11”。
gbase> SELECT USER() FROM dual;
+---------------------+
| USER()
|
+---------------------+
| root@172.168.83.11
|
+---------------------+
1 row in set
说明
这个值是用户连接的用户名和连接的主机名。它不同于CURRENT_
USER()的返回值。
示例2:用户可以精简到只剩用户名。

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
851
gbase> SELECT SUBSTRING_INDEX(USER(),'@',1) FROM dual;
+-------------------------------+
| SUBSTRING_INDEX(USER(),'@',1) |
+-------------------------------+
| root
|
+-------------------------------+
1 row in set
示例3:
USER()返回属于UTF8 字符集的值
(如果在安装时选择GBK 字符集的安
装包则返回属于GBK 字符集的值),因此用户也确保了“@”字符串文字可以
在该字符集中得到解释。
gbase> SELECT SUBSTRING_INDEX(USER(),'@',1) FROM dual;
+-------------------------------+
| SUBSTRING_INDEX(USER(),'@',1) |
+-------------------------------+
| root
|
+-------------------------------+
1 row in set


byteawithoutorderwithequalcolin(cstring)
描述:将输入转码转化成内部byteawithoutorderwithequalcol 形式。
参数类型:cstring
返回值类型:byteawithoutorderwithequalcol

byteawithoutorderwithequalcolout(byteawithoutorderwithequalcol)
描述:将内部byteawithoutorderwithequalcol 类型的数据转码转化为cstring 类型。
参数类型:byteawithoutorderwithequalcol
返回值类型:cstring

byteawithoutorderwithequalcolsend(byteawithoutorderwithequalcol)

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
379
描述:将byteawithoutorderwithequalcol 类型的数据转码转化为bytea 类型。
参数类型:byteawithoutorderwithequalcol
返回值类型:bytea

byteawithoutorderwithequalcolrecv(internal)
描述:将
byteawithoutorderwithequalcol
类型的数据转码转化为
byteawithoutorderwithequalcol 类型。
参数类型:internal
返回值类型:byteawithoutorderwithequalcol

byteawithoutorderwithequalcoltypmodin(_cstring)
描述:将
byteawithoutorderwithequalcol
类型的数据转码转化为
byteawithoutorderwithequalcol 类型。
参数类型:_cstring
返回值类型:int4

byteawithoutorderwithequalcoltypmodout(int4)
描述:将int4 类型的数据转码转化为cstring 类型。
参数类型:int4
返回值类型:cstring

byteawithoutordercolin(cstring)
描述:将输入转码转化成内部byteawithoutordercolin 形式。
参数类型:cstring
返回值类型:byteawithoutordercol

byteawithoutordercolout(byteawithoutordercol)
描述:将内部byteawithoutordercol 类型的数据转码转化为cstring 类型。

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
380
参数类型:byteawithoutordercol
返回值类型:cstring

byteawithoutordercolsend(byteawithoutordercol)
描述:将byteawithoutordercol 类型的数据转码转化为bytea 类型。
参数类型:byteawithoutordercol
返回值类型:bytea

byteawithoutordercolrecv(internal)
描述:将byteawithoutordercol 类型的数据转码转化为byteawithoutordercol 类型。
参数类型:internal
返回值类型:byteawithoutordercol

byteawithoutorderwithequalcolcmp(byteawithoutorderwithequalcol,
byteawithoutorderwithequalcol)
描述:
比较两个byteawithoutorderwithequalcol 类型的数据大小,
若第一个参数小于第二
个参数,返回-1,若等于,返回0,若大于,则返回1。
参数类型:byteawithoutorderwithequalcol, byteawithoutorderwithequalcol
返回值类型:int4

byteawithoutorderwithequalcolcmpbytear(byteawithoutorderwithequalcol, bytea)
描述:比较byteawithoutorderwithequalcol 和bytea 数据大小,若第一个参数小于第二个
参数,返回-1,若等于,返回0,若大于,则返回1。
参数类型:byteawithoutorderwithequalcol, bytea
返回值类型:int4

byteawithoutorderwithequalcolcmpbyteal(bytea, byteawithoutorderwithequalcol)
描述:比较bytea 和byteawithoutorderwithequalcol 数据大小,若第一个参数小于第二个

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
381
参数,返回-1,若等于,返回0,若大于,则返回1。
参数类型:byteawithoutorderwithequalcol, bytea
返回值类型:int4

byteawithoutorderwithequalcoleq(byteawithoutorderwithequalcol,
byteawithoutorderwithequalcol)
描述:比较两个byteawithoutorderwithequalcol 类型的数据是否相同,相同则返回true,
否则返回false。
参数类型:byteawithoutorderwithequalcol, bytea
返回值类型:bool

byteawithoutorderwithequalcoleqbyteal(bytea, byteawithoutorderwithequalcol)
描述:比较bytea 和byteawithoutorderwithequalcol 数据是否相同,相同则返回true,否
则返回false。
参数类型:bytea,byteawithoutorderwithequalcol
返回值类型:bool

byteawithoutorderwithequalcoleqbytear(byteawithoutorderwithequalcol, bytea)
描述:比较byteawithoutorderwithequalcol 和bytea 数据是否相同,相同则返回true,否
则返回false。
参数类型:byteawithoutorderwithequalcol, bytea
返回值类型:bool

byteawithoutorderwithequalcolne(byteawithoutorderwithequalcol,
byteawithoutorderwithequalcol)
描述:比较两个byteawithoutorderwithequalcol 类型的数据是否不相同,不相同则返回
true,否则返回false。

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
382
参数类型:byteawithoutorderwithequalcol, byteawithoutorderwithequalcol
返回值类型:bool

byteawithoutorderwithequalcolnebyteal(bytea, byteawithoutorderwithequalcol)
描述:比较bytea 和byteawithoutorderwithequalcol 数据是否相同,相同则返回true,否
则返回false。
参数类型:bytea,byteawithoutorderwithequalcol
返回值类型:bool

byteawithoutorderwithequalcolnebytear(byteawithoutorderwithequalcol, bytea)
描述:比较byteawithoutorderwithequalcol 和bytea 数据是否不相同,相同则返回true,
否则返回false。
参数类型:byteawithoutorderwithequalcol, bytea
返回值类型:bool

hll_hash_byteawithoutorderwithequalcol(byteawithoutorderwithequalcol)
描述:返回byteawithoutorderwithequalcol 的hll 哈希值。
参数类型:byteawithoutorderwithequalcol
返回值类型:hll_hashval
由于byteawithoutorderwithequalcolin 的实现会对cek 进行查找,并且判断是否为正常加
密后的数据类型。
因此如果用户输入数据的格式不为加密后的数据格式,
并且在本地不存在
对应cek 的情况下,会返回错误。
gbase=# SELECT * FROM
byteawithoutorderwithequalcolsend('\x907219912381298461289346129'::byteawith
outorderwithequalcol);
ERROR:
cek with OID 596711794 not found
LINE 1: SELECT * FROM byteawithoutorderwithequalcolsend('\x907219912...
^

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
383
gbase=# SELECT * FROM
byteawithoutordercolout('\x90721901999999999999912381298461289346129');
ERROR:
cek with OID 2566986098 not found
LINE 1: SELECT * FROM byteawithoutordercolout('\x9072190199999999999...
^
gbase=# SELECT * FROM
byteawithoutorderwithequalcolrecv('\x907219019999999999999123812984612893461
29'::byteawithoutorderwithequalcol);
ERROR:
cek with OID 2566986098 not found
LINE 1: SELECT * FROM byteawithoutorderwithequalcolrecv('\x907219019...
^
gbase=# SELECT * FROM
byteawithoutorderwithequalcolsend('\x907219019999999999999123812984612893461
29'::byteawithoutorderwithequalcol);
ERROR:
cek with OID 2566986098 not found
LINE 1: SELECT * FROM byteawithoutorderwithequalcolsend('\x907219019...
^