华为云用户手册

  • PG_LARGEOBJECT PG_LARGEOBJECT系统表保存那些标记着“大对象”的数据。一个大对象是使用其创建时分配的OID标识的。每个大对象都分解成足够小的小段或者“页面”以便以行的形式存储在PG_LARGEOBJECT里。每页的数据定义为LOBLKSIZE。 需要有系统管理员权限才可以访问此系统表。 表1 PG_LARGEOBJECT字段 名称 类型 引用 描述 loid oid PG_LARGEOBJECT_METADATA.oid 包含本页的大对象的标识符。 pageno integer - 本页在其大对象数据中的页码,从零开始计算。 data bytea - 存储在大对象中的实际数据。这些数据绝不会超过LOBLKSIZE字节,而且可能更少。 PG_LARGEOBJECT的每一行保存一个大对象的一个页面,从该对象内部的字节偏移(pageno * LOBLKSIZE)开始。这种实现允许松散的存储:页面可以丢失,而且可以比LOBLKSIZE字节少(即使它们不是对象的最后一页)。大对象内丢失的部分读做零。 父主题: 系统表
  • 示例 示例1:圆整函数参数类型解析。只有一个round函数有两个参数(第一个是numeric,第二个是integer)。所以下面的查询自动把第一个类型为integer的参数转换成numeric类型。 1 2 3 4 5 openGauss=# SELECT round(4, 4); round -------- 4.0000 (1 row) 实际上它被分析器转换成: 1 openGauss=# SELECT round(CAST (4 AS numeric), 4); 因为带小数点的数值常量初始时被赋予numeric类型,因此下面的查询将不需要类型转换,并且可能会略微高效一些: 1 openGauss=# SELECT round(4.0, 4); 示例2:子字符串函数类型解析。有好几个substr函数,其中一个接受text和integer类型。如果用一个未声明类型的字符串常量调用它,系统将选择接受string类型范畴的首选类型(也就是text类型)的候选函数。 1 2 3 4 5 openGauss=# SELECT substr('1234', 3); substr -------- 34 (1 row) 如果该字符串声明为varchar类型,就像从表中取出来的数据一样,分析器将试着将其转换成text类型: 1 2 3 4 5 openGauss=# SELECT substr(varchar '1234', 3); substr -------- 34 (1 row) 被分析器转换后实际上变成: 1 openGauss=# SELECT substr(CAST (varchar '1234' AS text), 3); 分析器从pg_cast表中了解到text和varchar是二进制兼容的,意思是说一个可以传递给接受另一个的函数而不需要做任何物理转换。因此,在这种情况下,实际上没有做任何类型转换。 而且,如果以integer为参数调用函数,分析器将试图将其转换成text类型: 1 2 3 4 5 openGauss=# SELECT substr(1234, 3); substr -------- 34 (1 row) 被分析器转换后实际上变成: 1 2 3 4 5 openGauss=# SELECT substr(CAST (1234 AS text), 3); substr -------- 34 (1 row)
  • 函数类型解析 从系统表pg_proc中选择所有可能被选到的函数。如果使用了一个不带模式修饰的函数名称,那么认为该函数是那些在当前搜索路径中的函数。如果给出一个带修饰的函数名,那么只考虑指定模式中的函数。 如果搜索路径中找到了多个不同参数类型的函数。将从中选择一个合适的函数。 查找和输入参数类型完全匹配的函数。如果找到一个,则用之。如果输入的实参类型都是unknown类型,则不会找到匹配的函数。 如果未找到完全匹配,请查看该函数是否为一个特殊的类型转换函数。 寻找最优匹配。 抛弃那些输入类型不匹配并且也不能隐式转换成匹配的候选函数。unknown文本在这种情况下可以转换成任何东西。如果只剩下一个候选项,则用之,否则继续下一步。 遍历所有候选函数,保留那些输入类型匹配最准确的。此时,域被看作和它们的基本类型相同。如果没有一个函数能准确匹配,则保留所有候选。如果只剩下一个候选项,则用之,否则继续下一步。 遍历所有候选函数,保留那些需要类型转换时接受首选类型位置最多的函数。如果没有接受首选类型的函数,则保留所有候选。如果只剩下一个候选项,则用之,否则继续下一步。 如果有任何输入参数是unknown类型,检查剩余的候选函数对应参数位置的类型范畴。在每一个能够接受字符串类型范畴的位置使用string类型(这种对字符串的偏爱是合适的,因为unknown文本确实像字符串)。另外,如果所有剩下的候选函数都接受相同的类型范畴,则选择该类型范畴,否则抛出一个错误(因为在没有更多线索的条件下无法做出正确的选择)。现在抛弃不接受选定的类型范畴的候选函数,然后,如果任意候选函数在那个范畴接受一个首选类型,则抛弃那些在该参数位置接受非首选类型的候选函数。如果没有一个候选符合这些测试则保留所有候选。如果只有一个候选函数符合,则使用它;否则,继续下一步。 如果同时有unknown和已知类型的参数,并且所有已知类型的参数有相同的类型,假设unknown参数也是这种类型,检查哪个候选函数可以在unknown参数位置接受这种类型。如果正好一个候选符合,那么使用它。否则,产生一个错误。
  • SUMMARY_STAT_XACT_USER_TABLES 显示集群内汇聚的命名空间中用户表的事务状态信息。 表1 SUMMARY_STAT_XACT_USER_TABLES字段 名称 类型 描述 schemaname name 该表的模式名。 relname name 表名。 seq_scan numeric 该表发起的顺序扫描数。 seq_tup_read numeric 顺序扫描抓取的活跃行数。 idx_scan numeric 该表发起的索引扫描数。 idx_tup_fetch numeric 索引扫描抓取的活跃行数。 n_tup_ins numeric 插入行数。 n_tup_upd numeric 更新行数。 n_tup_del numeric 删除行数。 n_tup_hot_upd numeric HOT更新行数(比如没有更新所需的单独索引)。 父主题: Object
  • 示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 --创建SCHEMA。 openGauss=# CREATE SCHEMA tpcds; --创建一个新表。 openGauss=# CREATE TABLE tpcds.table1(a int); --开启事务。 openGauss=# START TRANSACTION; --插入数据。 openGauss=# INSERT INTO tpcds.table1 VALUES (3); --建立保存点。 openGauss=# SAVEPOINT my_savepoint; --插入数据。 openGauss=# INSERT INTO tpcds.table1 VALUES (4); --删除保存点。 openGauss=# RELEASE SAVEPOINT my_savepoint; --提交事务。 openGauss=# COMMIT; --查询表的内容,会同时看到3和4。 openGauss=# SELECT * FROM tpcds.table1; --删除表。 openGauss=# DROP TABLE tpcds.table1; --删除SCHEMA。 openGauss=# DROP SCHEMA tpcds CASCADE;
  • 功能描述 RELEASE SAVEPOINT删除一个当前事务先前定义的保存点。 把一个保存点删除就令其无法作为回滚点使用,除此之外它没有其它用户可见的行为。它并不能撤销在保存点建立起来之后执行的命令的影响,要撤销那些命令可以使用ROLLBACK TO SAVEPOINT 。当不再需要的时候删除一个保存点可以令系统在事务结束之前提前回收一些资源。 RELEASE SAVEPOINT也删除所有在指定的保存点建立之后的所有保存点。
  • SUMMARY_STAT_SYS_TABLES 集群内汇聚pg_catalog、information_schema以及pg_toast模式下所有系统表的统计信息。 表1 SUMMARY_STAT_SYS_TABLES字段 名称 类型 描述 schemaname name 该表的模式名。 relname name 表名。 seq_scan numeric 该表发起的顺序扫描数。 seq_tup_read numeric 顺序扫描抓取的活跃行数。 idx_scan numeric 该表发起的索引扫描数。 idx_tup_fetch numeric 索引扫描抓取的活跃行数。 n_tup_ins numeric 插入行数。 n_tup_upd numeric 更新行数。 n_tup_del numeric 删除行数。 n_tup_hot_upd numeric HOT更新行数(比如没有更新所需的单独索引)。 n_live_tup numeric 估计活跃行数。 n_dead_tup numeric 估计死行数。 last_vacuum timestamp with time zone 最后一次该表是手动清理的(不计算VACUUM FULL)时间。 last_autovacuum timestamp with time zone 上次被autovacuum守护进程清理的时间。 last_analyze timestamp with time zone 上次手动分析该表的时间。 last_autoanalyze timestamp with time zone 上次被autovacuum守护进程分析的时间。 vacuum_count numeric 该表被手动清理的次数(不计算VACUUM FULL)。 autovacuum_count numeric 该表被autovacuum清理的次数。 analyze_count numeric 该表被手动分析的次数。 autoanalyze_count numeric 该表被autovacuum守护进程分析的次数。 父主题: Object
  • SUMMARY_WORKLOAD_TRANSACTION 显示集群内汇聚的负载事务信息。 表1 SUMMARY_WORKLOAD_TRANSACTION字段 名称 类型 描述 workload name 负载的名称。 commit_counter numeric 用户事务commit数量。 rollback_counter numeric 用户事务rollback数量。 resp_min bigint 用户事务最小响应时间(单位:微秒)。 resp_max bigint 用户事务最大响应时间(单位:微秒)。 resp_avg bigint 用户事务平均响应时间(单位:微秒)。 resp_total numeric 用户事务总响应时间(单位:微秒)。 bg_commit_counter numeric 后台事务commit数量。 bg_rollback_counter numeric 后台事务rollback数量。 bg_resp_min bigint 后台事务最小响应时间(单位:微秒)。 bg_resp_max bigint 后台事务最大响应时间(单位:微秒)。 bg_resp_avg bigint 后台事务平均响应时间(单位:微秒)。 bg_resp_total numeric 后台事务总响应时间(单位:微秒)。 父主题: Workload
  • USER_ LOG IN USER_LOGIN用来记录用户登录和退出次数的相关信息。 表1 USER_LOGIN字段 名称 类型 描述 node_name text 节点名称。 user_name text 用户名称。 user_id integer 用户oid(同pg_authid中的oid字段)。 login_counter bigint 登录次数。 logout_counter bigint 退出次数。 父主题: Utility
  • SQL调优指南 SQL调优的唯一目的是“资源利用最大化”,即CPU、内存、磁盘I/O、网络I/O四种资源利用最大化。所有调优手段都是围绕资源使用开展的。所谓资源利用最大化是指SQL语句尽量高效,节省资源开销,以最小的代价实现最大的效益。比如做典型点查询的时候,可以用seqscan+filter(即读取每一条元组和点查询条件进行匹配)实现,也可以通过indexscan实现,显然indexscan可以以更小的代价实现相同的效果。 根据硬件资源和客户的业务特征确定合理的集群部署方案和表定义是数据库在多数情况下满足性能要求的基础。下文的调优说明假设您已根据“软件安装”指引在安装过程中按照合理的集群方案完成了安装,且已经根据“开发设计建议”的指引进行了数据库设计。 Query执行流程 SQL执行计划介绍 调优流程 更新统计信息 审视和修改表定义 典型SQL调优点 经验总结:SQL语句改写规则 SQL调优关键参数调整 使用Plan Hint进行调优 检查隐式转换的性能问题 实际调优案例
  • 事务管理 在事务管理上, GaussDB 采取了MVCC(多版本并发控制)结合两阶段锁的方式,其特点是读写之间不阻塞。GaussDB的MVCC没有将历史版本数据统一存放,而是和当前元组的版本放在了一起。GaussDB没有回滚段的概念,但是为了定期清除历史版本数据,GaussDB引入了VACUUM线程。一般情况下,除非用户要做性能调优,否则不用特别关注VACUUM线程。此外,GaussDB对于单语句查询(没有使用BEGIN等语句显示启动事务块)是自动提交事务的。
  • 示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 --创建用户组。 openGauss=# CREATE GROUP super_users WITH PASSWORD "********"; --创建用户。 openGauss=# CREATE ROLE lche WITH PASSWORD "********"; --创建用户。 openGauss=# CREATE ROLE jim WITH PASSWORD "********"; --向用户组中添加用户。 openGauss=# ALTER GROUP super_users ADD USER lche, jim; --从用户组中删除用户。 openGauss=# ALTER GROUP super_users DROP USER jim; --修改用户组的名称。 openGauss=# ALTER GROUP super_users RENAME TO normal_users; --删除用户。 openGauss=# DROP ROLE lche, jim; --删除用户组。 openGauss=# DROP GROUP normal_users;
  • 语法格式 向用户组中添加用户。 1 2 ALTER GROUP group_name ADD USER user_name [, ... ]; 从用户组中删除用户。 1 2 ALTER GROUP group_name DROP USER user_name [, ... ]; 修改用户组的名称。 1 2 ALTER GROUP group_name RENAME TO new_name;
  • PG_LARGEOBJECT_METADATA PG_LARGEOBJECT_METADATA系统表存储与大数据相关的元数据。实际的大对象数据存储在PG_LARGEOBJECT里。 表1 PG_LARGEOBJECT_METADATA字段 名称 类型 引用 描述 oid oid - 行标识符(隐含字段,必须明确选择)。 lomowner oid PG_AUTHID.oid 大对象的所有者。 lomacl aclitem[] - 访问权限。 父主题: 系统表
  • hll_default_regwidth(废弃) 参数说明:该参数可以指定hll数据结构每个桶的位数,该值越大,hll所占内存越高。hll_default_regwidth和hll_default_log2m可以决定当前hll能够计算的最大distinct value。当前regwidth设为固定值,该参数不再使用。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:整型,1~5。 默认值:5
  • hll_default_expthresh(废弃) 参数说明:该参数可以用来设置从Explicit模式到Sparse模式的默认阈值大小。当前已经使用参数hll_default_log2explicit替代类似功能。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:整型,-1~7。-1表示自动模式,0表示跳过Explicit模式,取1-7表示在基数到达2hll_default_expthresh时切换模式。 默认值:-1
  • 内核错误信息 ER RMS G: "unsupported syntax: ENCRYPTED WITH in this operation" SQLSTATE: 42601 CAUSE: "client encryption feature is not supported this operation." ACTION: "Check client encryption feature whether supported this operation." ERRMSG: "invalid grant operation" SQLSTATE: 0LP01 CAUSE: "Grant options cannnot be granted to public." ACTION: "Grant grant options to roles." ERRMSG: "unrecognized object kind: %d" SQLSTATE: XX004 CAUSE: "The object type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "unrecognized GrantStmt.targtype: %d" SQLSTATE: XX004 CAUSE: "The target type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported target types." ERRMSG: "invalid grant operation" SQLSTATE: 0LP01 CAUSE: "Grant to public operation is forbidden in security mode." ACTION: "Don't grant to public in security mode." ERRMSG: "unrecognized object type" SQLSTATE: XX004 CAUSE: "The object type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "invalid grant/revoke operation" SQLSTATE: 0LP01 CAUSE: "Column privileges are only valid for relations in GRANT/REVOKE." ACTION: "Use the column privileges only for relations." ERRMSG: "invalid AccessPriv node" SQLSTATE: 0LP01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "unrecognized GrantStmt.objtype: %d" SQLSTATE: XX004 CAUSE: "The object type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "undefined client master key" SQLSTATE: 42705 CAUSE: "The client master key does not exist." ACTION: "Check whether the client master key exists." ERRMSG: "undefined column encryption key" SQLSTATE: 42705 CAUSE: "The column encryption key does not exist." ACTION: "Check whether the column encryption key exists." ERRMSG: "large object %u does not exist" SQLSTATE: 42704 CAUSE: "The large object does not exist." ACTION: "Check whether the large object exists." ERRMSG: "redundant options" SQLSTATE: 42601 CAUSE: "The syntax 'schemas' is redundant in ALTER DEFAULT PRIVILEGES statement." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax." ERRMSG: "redundant options" SQLSTATE: 42601 CAUSE: "The syntax 'roles' is redundant in ALTER DEFAULT PRIVILEGES statement." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax." ERRMSG: "option '%s' not recognized" SQLSTATE: 42601 CAUSE: "The option in ALTER DEFAULT PRIVILEGES statement is not supported." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax." ERRMSG: "unrecognized GrantStmt.objtype: %d" SQLSTATE: XX004 CAUSE: "The object type is not supported for ALTER DEFAULT PRIVILEGES." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax to obtain the supported object types." ERRMSG: "invalid alter default privileges operation" SQLSTATE: 0LP01 CAUSE: "Default privileges cannot be set for columns." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax." ERRMSG: "unrecognized objtype: %d" SQLSTATE: XX004 CAUSE: "The object type is not supported for default privileges." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax to obtain the supported object types." ERRMSG: "could not find tuple for default ACL %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "unexpected default ACL type: %d" SQLSTATE: 0LP01 CAUSE: "The object type is not supported for default privilege." ACTION: "Check ALTER DEFAULT PRIVILEGES syntax to obtain the supported object types." ERRMSG: "invalid object id" SQLSTATE: 0LP01 CAUSE: "The object type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "undefined column" SQLSTATE: 42703 CAUSE: "The column of the relation does not exist." ACTION: "Check whether the column exists." ERRMSG: "column number out of range" SQLSTATE: 0LP01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for attribute %d of relation %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for relation %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "unsupported object type" SQLSTATE: 42809 CAUSE: "Index type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "unsupported object type" SQLSTATE: 42809 CAUSE: "Composite type is not supported for GRANT/REVOKE." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "wrong object type" SQLSTATE: 42809 CAUSE: "GRANT/REVOKE SEQUENCE only support sequence objects." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "invalid privilege type USAGE for table" SQLSTATE: 0LP01 CAUSE: "GRANT/REVOKE TABLE do not support USAGE privilege." ACTION: "Check GRANT/REVOKE syntax to obtain the supported privilege types for tables." ERRMSG: "invalid privilege type %s for column" SQLSTATE: 0LP01 CAUSE: "The privilege type is not supported for column object." ACTION: "Check GRANT/REVOKE syntax to obtain the supported privilege types for column object." ERRMSG: "cache lookup failed for database %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for foreign-data wrapper %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for foreign server %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for function %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for language %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "Grant/revoke on untrusted languages if forbidden." SQLSTATE: 0LP01 CAUSE: "Grant/revoke on untrusted languages if forbidden." ACTION: "Support grant/revoke on trusted C languages" ERRMSG: "cache lookup failed for large object %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for namespace %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "Role %s has not privilege to grant/revoke node group %s." SQLSTATE: 42501 CAUSE: "Role has not privilege to grant/revoke node group." ACTION: "Must have sysadmin privilege." ERRMSG: "Can not grant CREATE privilege on node group %u to role %u in node group %u." SQLSTATE: 42501 CAUSE: "Role has not privilege to grant CREATE privilege node group." ACTION: "Must have sysadmin privilege." ERRMSG: "cache lookup failed for tablespace %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for type %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cannot set privileges of array types" SQLSTATE: 0LP01 CAUSE: "Cannot set privileges of array types." ACTION: "Set the privileges of the element type instead." ERRMSG: "wrong object type" SQLSTATE: 42809 CAUSE: "GRANT/REVOKE DOMAIN only support domain objects." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "cache lookup failed for client master key %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for column encryption key %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "cache lookup failed for directory %u" SQLSTATE: 29P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "unrecognized privilege type '%s'" SQLSTATE: 42601 CAUSE: "The privilege type is not supported." ACTION: "Check GRANT/REVOKE syntax to obtain the supported privilege types." ERRMSG: "unrecognized privilege: %d" SQLSTATE: XX004 CAUSE: "The privilege type is not supported." ACTION: "Check GRANT/REVOKE syntax to obtain the supported privilege types." ERRMSG: "unrecognized AclResult" SQLSTATE: XX004 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "permission denied for column '%s' of relation '%s'" SQLSTATE: 42501 CAUSE: "Insufficient privileges for the column." ACTION: "Select the system tables to get the acl of the column." ERRMSG: "role with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "unrecognized objkind: %d" SQLSTATE: XX004 CAUSE: "The object type is not supported for privilege check." ACTION: "Check GRANT/REVOKE syntax to obtain the supported object types." ERRMSG: "attribute %d of relation with OID %u does not exist" SQLSTATE: 42703 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "the column has been dropped" SQLSTATE: 42703 CAUSE: "The column does not exist." ACTION: "Check whether the column exists." ERRMSG: "relation with OID %u does not exist" SQLSTATE: 42P01 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "invalid group" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "database with OID %u does not exist" SQLSTATE: 3D000 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "directory with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "function with OID %u does not exist" SQLSTATE: 42883 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "client master key with OID %u does not exist" SQLSTATE: 42705 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "language with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "large object %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "schema with OID %u does not exist" SQLSTATE: 3F001 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "node group with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "tablespace with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "foreign-data wrapper with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "foreign server with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "type with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "operator with OID %u does not exist" SQLSTATE: 42883 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "column encryption key with OID %u does not exist" SQLSTATE: 42705 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "operator class with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "operator family with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "text search dictionary with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "text search configuration with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "collation with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "conversion with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "synonym with OID %u does not exist" SQLSTATE: 42704 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "package can not create the same name with schema." SQLSTATE: 22023 CAUSE: "Package name conflict" ACTION: "Please rename package name" ERRMSG: "type is not exists %s." SQLSTATE: 22023 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "This input type is not supported for tdigest_in()" SQLSTATE: 0A000 CAUSE: "input type is not supported" ACTION: "Check tdigest_in syntax to obtain the supported privilege types" ERRMSG: "Failed to apply for memory" SQLSTATE: 53200 CAUSE: "palloc failed" ACTION: "Check memory" ERRMSG: "Failed to get tde info from relation '%s'." SQLSTATE: XX005 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "SPI_connect failed: %s" SQLSTATE: SP001 CAUSE: "System error." ACTION: "Analyze the error message before the error" ERRMSG: "permission denied for terminate snapshot thread" SQLSTATE: 42501 CAUSE: "The user does not have system admin privilege" ACTION: "Grant system admin to user" ERRMSG: "terminate snapshot thread failed" SQLSTATE: OP001 CAUSE: "Execution failed due to: %s" ACTION: "check if snapshot thread exists" ERRMSG: "terminate snapshot thread failed" SQLSTATE: OP001 CAUSE: "restart wdr snapshot thread timeoutor The thread did not respond to the kill signal" ACTION: "Check the wdr snapshot thread is restarted" ERRMSG: "set lockwait_timeout failed" SQLSTATE: XX000 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "permission denied for create WDR Snapshot" SQLSTATE: 42501 CAUSE: "The user does not have system admin privilege" ACTION: "Grant system admin to user" ERRMSG: "WDR snapshot request can not be accepted, please retry later" SQLSTATE: OP001 CAUSE: "wdr snapshot thread does not exist" ACTION: "Check if wdr snapshot thread exists" ERRMSG: "Cannot respond to WDR snapshot request" SQLSTATE: OP001 CAUSE: "Execution failed due to: %s" ACTION: "Check if wdr snapshot thread exists" ERRMSG: "query(%s) can not get datum values" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "create sequence failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check if sequence can be created" ERRMSG: "update snapshot end time stamp filled" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "query can not get datum values" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "SPI_connect failed: %s" SQLSTATE: XX000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "query(%s) execute failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "clean table of snap_%s is failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "analyze table failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "insert into tables_snap_timestamp start time stamp is failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "insert data failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful and check whether the query can be executed" ERRMSG: "update tables_snap_timestamp end time stamp is failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "clean snapshot id %lu is failed in snapshot table" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful and check whether the query can be executed" ERRMSG: "clean snapshot failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "can not create snapshot stat table" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "create WDR snapshot data table failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "insert into tables_snap_timestamp start time stamp failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "insert into snap_%s is failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "update tables_snap_timestamp end time stamp failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "create index failed" SQLSTATE: 22000 CAUSE: "System error." ACTION: "Check whether the query can be executed" ERRMSG: "analyze table, connection failed: %s" SQLSTATE: XX000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "snapshot thread SPI_connect failed: %s" SQLSTATE: XX000 CAUSE: "System error." ACTION: "Check whether the snapshot retry is successful" ERRMSG: "Distributed key column can't be transformed" SQLSTATE: 42P10 CAUSE: "There is a risk of violating uniqueness when transforming distribution columns." ACTION: "Change transform column." ERRMSG: "cannot convert %s to %s" SQLSTATE: 42804 CAUSE: "There is no conversion path in pg_cast." ACTION: "Rewrite or cast the expression." ERRMSG: "create matview on TDE table failed" SQLSTATE: 0A000 CAUSE: "create materialized views is not supported on TDE table" ACTION: "check CREATE syntax about create the materialized views" ERRMSG: "schema name can not same as package" SQLSTATE: 22023 CAUSE: "schema name conflict" ACTION: "rename schema name" ERRMSG: "Unrecognized commandType when checking read-only attribute." SQLSTATE: XX004 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Fail to generate subquery plan." SQLSTATE: XX005 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Unrecognized node type when processing qual condition." SQLSTATE: XX004 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Unrecognized node type when processing const parameters." SQLSTATE: XX004 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "SELECT FOR UPDATE/SHARE is not allowed with UNION/INTERSECT/EXCEPT" SQLSTATE: 0A000 CAUSE: "SQL uses unsupported feature." ACTION: "Modify SQL statement according to the manual." ERRMSG: "GROUP BY cannot be implemented." SQLSTATE: 0A000 CAUSE: "GROUP BY uses unsupported datatypes." ACTION: "Modify SQL statement according to the manual." ERRMSG: "Unrecognized node type when extracting index." SQLSTATE: XX004 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Ordering operator cannot be identified." SQLSTATE: 42883 CAUSE: "Grouping set columns must be able to sort their inputs." ACTION: "Modify SQL statement according to the manual." ERRMSG: "DISTINCT cannot be implemented." SQLSTATE: 0A000 CAUSE: "DISTINCT uses unsupported datatypes." ACTION: "Modify SQL statement according to the manual." ERRMSG: "Failed to locate grouping columns." SQLSTATE: 55000 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Resjunk output columns are not implemented." SQLSTATE: 20000 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "PARTITION BY cannot be implemented." SQLSTATE: 0A000 CAUSE: "PARTITION BY uses unsupported datatypes." ACTION: "Modify SQL statement according to the manual." ERRMSG: "ORDER BY cannot be implemented." SQLSTATE: 0A000 CAUSE: "ORDER BY uses unsupported datatypes." ACTION: "Modify SQL statement according to the manual." ERRMSG: "Failed to deconstruct sort operators into partitioning/ordering operators." SQLSTATE: D0011 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Pool size should not be zero" SQLSTATE: 22012 CAUSE: "Compute pool configuration file contains error." ACTION: "Please check the value of 'pl' in cp_client.conf." ERRMSG: "Failed to get the runtime info from the compute pool." SQLSTATE: 22004 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "Version is not compatible between local cluster and the compute pool." SQLSTATE: XX008 CAUSE: "Compute pool is not installed appropriately." ACTION: "Configure compute pool according to manual." ERRMSG: "No optional index path is found." SQLSTATE: 01000 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "MERGE INTO on replicated table does not yet support using distributed tables." SQLSTATE: 0A000 CAUSE: "SQL uses unsupported feature." ACTION: "Modify SQL statement according to the manual." ERRMSG: "Fail to find ForeignScan node!" SQLSTATE: P0002 CAUSE: "System error." ACTION: "Contact Huawei Engineer." ERRMSG: "sql advisor don't support none table, temp table, system table." SQLSTATE: 42601 CAUSE: "sql advisor don't support none table, temp table, system table." ACTION: "check query component" ERRMSG: "Invalid autonomous transaction return datatypes" SQLSTATE: P0000 CAUSE: "PL/SQL uses unsupported feature." ACTION: "Contact Huawei Engineer." ERRMSG: "new row for relation '%s' violates check constraint '%s'" SQLSTATE: 23514 CAUSE: "some rows copy failed" ACTION: "check table defination" ERRMSG: "new row for relation '%s' violates check constraint '%s'" SQLSTATE: 23514 CAUSE: "some rows copy failed" ACTION: "set client_min_messages = info for more details" ERRMSG: "get gauss home path is NULL" SQLSTATE: XX005 CAUSE: "gauss home path not set" ACTION: "check if $GAUSSHOME is exist" ERRMSG: "unable to open kms_iam_info.json file" SQLSTATE: 58P03 CAUSE: "file not exist or broken" ACTION: "check the kms_iam_info.json file" ERRMSG: "can not get password plaintext" SQLSTATE: XX005 CAUSE: "file not exist or broken" ACTION: "check the password cipher rand file" ERRMSG: " IAM info json key is NULL" SQLSTATE: XX005 CAUSE: "IAM info value error" ACTION: "check tde_config kms_iam_info.json file" ERRMSG: "get internal password is NULL" SQLSTATE: XX005 CAUSE: "cipher rand file missing" ACTION: "check password cipher rand file" ERRMSG: "KMS info json key is NULL" SQLSTATE: XX005 CAUSE: "KMS info value error" ACTION: "check tde_config kms_iam_info.json file" ERRMSG: "unable to get json file" SQLSTATE: 58P03 CAUSE: "parse json file failed" ACTION: "check the kms_iam_info.json file format" ERRMSG: "get JSON tree is NULL" SQLSTATE: XX005 CAUSE: "get KMS JSON tree failed" ACTION: "check input prarmeter or config.ini file" ERRMSG: "failed to get json tree" SQLSTATE: XX005 CAUSE: "config.ini json tree error" ACTION: "check input prarmeter or config.ini file" ERRMSG: "failed to set the value of json tree" SQLSTATE: XX005 CAUSE: "config.ini json tree error" ACTION: "check input prarmeter or config.ini file" ERRMSG: "http request failed" SQLSTATE: XX005 CAUSE: "http request error" ACTION: "check KMS or IAM connect or config parameter" ERRMSG: "get iam token or iam agency token is NULL" SQLSTATE: XX005 CAUSE: "connect IAM failed" ACTION: "check if your env can connect with IAM server" ERRMSG: "KMS dek json key is NULL" SQLSTATE: XX005 CAUSE: "KMS return value error" ACTION: "check KMS config paramenter" ERRMSG: "get kms dek is NULL" SQLSTATE: XX005 CAUSE: "connect KMS failed" ACTION: "check if your env can connect with KMS server" ERRMSG: "get http header is NULL" SQLSTATE: XX005 CAUSE: "http request failed" ACTION: "check IAM config parameter" ERRMSG: "create KMS dek failed" SQLSTATE: XX005 CAUSE: "KMS error" ACTION: "check KMS connect or config parameter" ERRMSG: "get KMS dek failed" SQLSTATE: XX005 CAUSE: "KMS error" ACTION: "check KMS connect or config parameter" ERRMSG: "get KMS DEK is NULL" SQLSTATE: XX005 CAUSE: "get KMS dek_plaintext failed" ACTION: "check KMS network or cipher is right" ERRMSG: "create matview with TDE failed" SQLSTATE: 0A000 CAUSE: "TDE feature is not supported for Create materialized views" ACTION: "check CREATE syntax about create the materialized views" ERRMSG: "failed to add item to the index page" SQLSTATE: XX002 CAUSE: "System error." ACTION: "Check WARNINGS for the details." ERRMSG: "index row size %lu exceeds maximum %lu for index '%s'" SQLSTATE: 54000 CAUSE: "Values larger than 1/3 of a buffer page cannot be indexed." ACTION: "Consider a function index of an MD5 hash of the value, or use full text indexing." ERRMSG: "fail to insert a tuple to an orderd index, the ordered tuple list is corrupted" SQLSTATE: XX002 CAUSE: "System error." ACTION: "Contact engineer to support." ERRMSG: "Tag field is too long." SQLSTATE: 54000 CAUSE: "Tag buffer overflow." ACTION: "Shorten tag Key." 父主题: 错误日志信息参考
  • 参数说明 groupname 要删除的节点组名。 取值范围:已存在的节点组。 DISTRIBUTE FROM src_group_name 如果被删除的节点组是从src_group_name Node group节点组重分布过来的,删除该节点组需要指定src_group_name,以便将重分布后的节点分布信息同步到src_group_name指定的Node group节点组。该语句仅仅用于扩容重分布,用户不建议直接使用,以免导致数据分布错误和Node group不可用。
  • 原型 int PQsendQueryParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char * const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat);
  • 示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 --创建一个角色,名为manager,密码为********。 openGauss=# CREATE ROLE manager IDENTIFIED BY '********'; --创建一个角色,从2015年1月1日开始生效,到2026年1月1日失效。 openGauss=# CREATE ROLE miriam WITH LOGIN PASSWORD '********' VALID BEGIN '2015-01-01' VALID UNTIL '2026-01-01'; --修改角色manager的密码为**********。 openGauss=# ALTER ROLE manager IDENTIFIED BY '**********' REPLACE '********'; --修改角色manager为系统管理员。 openGauss=# ALTER ROLE manager SYSADMIN; --删除角色manager。 openGauss=# DROP ROLE manager; --删除角色miriam。 openGauss=# DROP GROUP miriam;
  • 语法格式 1 CREATE ROLE role_name [ [ WITH ] option [ ... ] ] [ ENCRYPTED | UNENCRYPTED ] { PASSWORD | IDENTIFIED BY } { 'password' [EXPIRED] | DISABLE }; 其中角色信息设置子句option语法为: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 {SYSADMIN | NOSYSADMIN} | {MONADMIN | NOMONADMIN} | {OPRADMIN | NOOPRADMIN} | {POLADMIN | NOPOLADMIN} | {AUDITADMIN | NOAUDITADMIN} | {CREATEDB | NOCREATEDB} | {USEFT | NOUSEFT} | {CREATEROLE | NOCREATEROLE} | {INHERIT | NOINHERIT} | {LOGIN | NOLOGIN} | {REPLICATION | NOREPLICATION} | {VCADMIN | NOVCADMIN} | {PERSISTENCE | NOPERSISTENCE} | CONNECTION LIMIT connlimit | VALID BEGIN 'timestamp' | VALID UNTIL 'timestamp' | USER GROUP 'groupuser' | PERM SPACE 'spacelimit' | TEMP SPACE 'tmpspacelimit' | SPILL SPACE 'spillspacelimit' | NODE GROUP logic_cluster_name | IN ROLE role_name [, ...] | IN GROUP role_name [, ...] | ROLE role_name [, ...] | ADMIN rol e_name [, ...] | USER role_name [, ...] | SYSID uid | DEFAULT TABLESPACE tablespace_name | PROFILE DEFAULT | PROFILE profile_name | PGUSER
  • GS_MASKING_POLICY_FILTERS GS_MASKING_POLICY_FILTERS系统表记录动态数据脱敏策略对应的用户过滤条件,当用户条件满足FILTER条件时,对应的脱敏策略才会生效。需要有系统管理员或安全策略管理员权限才可以访问此系统表。 表1 GS_MASKING_POLICY_FILTERS表字段 名称 类型 描述 oid oid 行标识符(隐含属性,必须明确选择)。 filtertype name 过滤类型。目前值仅为logical_expr。 filterlabelname name 过滤范围。目前值仅为logical_expr。 policyoid oid 该条记录所属的脱敏策略的oid,对应GS_MASKING_POLICY中的oid。 modifydate timestamp without time zone 该条用户过滤条件创建或修改的最新时间戳。 logicaloperator text 过滤条件的波兰表达式。 父主题: 系统表
  • PG_STATIO_ALL_INDEXES PG_STATIO_ALL_INDEXES视图可用来查询当前数据库中的每个索引行的信息,显示特定索引的I/O的统计信息。 表1 PG_STATIO_ALL_INDEXES字段 名称 类型 描述 relid oid 索引的表的OID。 indexrelid oid 该索引的OID。 schemaname name 该索引的模式名。 relname name 该索引的表名。 indexrelname name 索引名称。 idx_blks_read bigint 从索引中读取的磁盘块数。 idx_blks_hit bigint 索引命中缓存数。 父主题: 系统视图
  • 不支持下推的函数 首先介绍函数的易变性。在GaussDB中共分三种形态: IMMUTABLE 表示该函数在给出同样的参数值时总是返回同样的结果。 STABLE 表示该函数不能修改数据库,对相同参数值,在同一次表扫描里,该函数的返回值不变,但是返回值可能在不同SQL语句之间变化。 VOLATILE 表示该函数值可以在一次表扫描内改变,因此不会做任何优化。 函数易变性可以查询pg_proc的provolatile字段获得,i代表IMMUTABLE,s代表STABLE,v代表VOLATILE。另外,在pg_proc中的proshippable字段,取值范围为t/f/NULL,这个字段与provolatile字段一起用于描述函数是否下推。 如果函数的provolatile属性为i,则无论proshippable的值是否为t,则函数始终可以下推。 如果函数的provolatile属性为s或v,则仅当proshippable的值为t时,函数可以下推。 random,exec_hadoop_sql,exec_on_extension如果出现CTE中,也不下推。因为这种场景下下推可能出现结果错误。 对于用户自定义函数,可以在创建函数的时候指定provolatile和proshippable属性的值,详细请参考CREATE FUNCTION。 对于函数不能下推的场景: 如果是系统函数,建议根据业务等价替换这个函数。 如果是自定义函数,建议分析客户业务场景,看函数的provolatile和proshippable属性定义是否正确。
  • 语句下推介绍 目前,GaussDB优化器在分布式框架下制定语句的执行策略时,有三种执行计划方式:生成下推语句计划、生成分布式执行计划、生成发送语句的分布式执行计划。 下推语句计划:指直接将完整的查询语句从CN发送到DN进行执行,然后将执行结果返回给CN。 分布式执行计划:指CN对查询语句进行编译和优化,生成计划树,再将计划树发送给DN进行执行,并在执行完毕后返回结果到CN。 发送语句的分布式执行计划:上述两种方式都不可行时,将可下推的查询部分组成查询语句(多为基表扫描语句)下推到DN进行执行,获取中间结果到CN,然后在CN执行剩下的部分。 在第3种策略中,要将大量中间结果从DN发送到CN,并且要在CN运行不能下推的部分语句,会导致CN成为性能瓶颈(带宽、存储、计算等)。在进行性能调优的时候,应尽量避免只能选择第3种策略的查询语句。 执行语句不能下推是因为语句中含有不支持下推的函数或者不支持下推的语法。一般都可以通过等价改写规避执行计划不能下推的问题。
  • ADM_TABLES ADM_TABLES视图显示数据库中所有表的信息。默认只有系统管理员权限才可以访问此系统视图,普通用户需要授权才可以访问。该视图同时存在于PG_CATALOG和SYS Schema下。 表1 ADM_TABLES字段 名称 类型 描述 owner character varying(64) 表的所有者。 table_name character varying(64) 表名称。 tablespace_name character varying(64) 存储表的表空间名称。 dropped character varying 当前表是否已删除: YES:表示已删除。 NO:表示未删除。 num_rows numeric 表的估计行数。 status character varying(8) 当前表是否有效。 VALID:当前表有效。 UNUSABLE:当前表不可用。 temporary character(1) 表是否为临时表: Y:表示是临时表。 N:表示不是临时表。 父主题: 系统视图
  • GLOBAL_STATIO_ALL_INDEXES GLOBAL_STATIO_ALL_INDEXES视图包含各节点的数据库中的每个索引行,显示特定索引的I/O的统计。 表1 GLOBAL_STATIO_ALL_INDEXES字段 名称 类型 描述 node_name name 节点名称。 relid oid 索引的表的OID。 indexrelid oid 该索引的OID。 schemaname name 该索引的模式名。 relname name 该索引的表名。 indexrelname name 索引名称。 idx_blks_read numeric 从索引中读取的磁盘块数。 idx_blks_hit numeric 索引命中缓存数。 父主题: Cache/IO
  • 存储过程 商业规则和业务逻辑可以通过程序存储在GaussDB中,这个程序就是存储过程。 存储过程是SQL、PL/SQL、Java语句的组合。存储过程使执行商业规则的代码可以从应用程序中移动到数据库。从而,代码存储一次能够被多个程序使用。 存储过程的创建及调用办法请参考CREATE PROCEDURE。 PL/SQL语言函数节所提到的PL/SQL语言创建的函数与存储过程的应用方法相通。下面各节中,除非特别声明,否则内容通用于存储过程和PL/SQL语言函数。 父主题: 存储过程
  • GLOBAL_STAT_ALL_TABLES 显示各节点数据中每个表(包括TOAST表)的一行的统计信息。 表1 GLOBAL_STAT_ALL_TABLES字段 名称 类型 描述 node_name name 节点名称。 relid oid 表的OID。 schemaname name 该表的模式名。 relname name 表名。 seq_scan bigint 该表发起的顺序扫描数。 seq_tup_read bigint 顺序扫描抓取的活跃行数。 idx_scan bigint 该表发起的索引扫描数。 idx_tup_fetch bigint 索引扫描抓取的活跃行数。 n_tup_ins bigint 插入行数。 n_tup_upd bigint 更新行数。 n_tup_del bigint 删除行数。 n_tup_hot_upd bigint HOT更新行数(比如没有更新所需的单独索引)。 n_live_tup bigint 估计活跃行数。 n_dead_tup bigint 估计死行数。 last_vacuum timestamp with time zone 最后一次该表是手动清理的(不计算VACUUM FULL)的时间。 last_autovacuum timestamp with time zone 上次被autovacuum守护进程清理的时间。 last_analyze timestamp with time zone 上次手动分析该表的时间。 last_autoanalyze timestamp with time zone 上次被autovacuum守护进程分析时间。 vacuum_count bigint 该表被手动清理的次数(不计算VACUUM FULL)。 autovacuum_count bigint 该表被autovacuum清理的次数。 analyze_count bigint 该表被手动分析的次数。 autoanalyze_count bigint 该表被autovacuum守护进程分析的次数。 父主题: Object
  • ADM_HIST_SQLSTAT ADM_HIST_SQLSTAT视图描述当前节点的执行语句的信息。 表1 ADM_HIST_SQLSTAT字段 名称 类型 描述 instance_number integer 快照的实例编号。 sql_id bigint 查询标识。 plan_hash_value bigint 归一化SQL ID。 module text 包含第一次解析 SQL 语句时正在执行的模块的名称。 elapsed_time_delta bigint 有效的DB时间花费,多线程将累加(单位:微秒)。 cpu_time_delta bigint CPU时间(单位:微秒)。 executions_delta integer 自从它被带入库缓存以来在此对象上发生的执行次数增量。 iowait_delta bigint I/O上的时间花费(单位:微秒)。 apwait_delta integer 应用程序等待时间的Delta值。 rows_processed_delta bigint SELECT返回的结果集行数。 snap_id integer 唯一快照 ID。 父主题: 系统视图
共100000条