返回首页

gbase数据、南大通用产品文档:GBase8sSYSCONSTRAINTS

更新日期:2024年09月11日

sysconstraints 系统目录表列出了对每个数据库表中的各个列设置的约束。在
sysindexes 系统目录表(或 GBase 8s 的 sysindices 视图)中对在 sysindexes 或

GBase 8s SQL 指南:参考
南大通用数据技术股份有限公司 - 34 -
sysindices 中尚未有对应条目的每个唯一的主键或引用约束也设置了一个条目。由于索引
可以共享,所以多个约束可以与一个索引相关联。sysconstraints 表具有以下列。
表 11. SYSCONSTRAINTS 表列描述

类型
解释
constrid
SERIAL
唯一地标识约束的代码
constrname
VARCHAR(128)
约束的名称
owner
VARCHAR(32)
约束所有者的名称
tabid
INTEGER
唯一地标识表的代码
constrtype
CHAR(1)
标识约束类型的代码:
C = 检查约束
N = Not NULL
P = 主键
R = 引用
T = 表
U = 唯一

idxname
VARCHAR(128)
与约束相对应的索引的名

collation
CHAR(32)
创建约束时的排列顺序。

constrname 和 owner 列的组合索引只允许唯一值。tabid 列的索引允许重复值,但
constrid 列的索引只允许唯一值。
对于检查约束(其中 constrtype = C),idxname 始终为 NULL。有关每个检查约束
的其他信息包括在 syschecks 和 syscoldepend 系统目录表中。

这些配置参数提供了影响查询优化器选择查询规划的原始方法。
如果优化器为特定的查
询选择的缺省规划并不是最优的,
可以通过使用这些配置参数强制优化器选择一个不同的规
划来临时解决这个问题。更好的方法包括调节优化器开销常量、手动运行ANALYZE、增加
配置参数default_statistics_target 的值、增加使用ALTER TABLE SET STATISTICS 为指定列
增加收集的统计信息。

描述从中捕获数据的表。
公共标头中有效负载大小字段中的值表示列名和数据类型列表占用的字节
数。
特定于CDC_REC_TABSCHEMA 记录的报头位于公共报头之后。
表3-9.CDC_REC_TABSCHEMA 记录的格式
区分
长度
描述
User data
4 bytes
The table identifier that
was specified in the
cdc_startcapture() function for
the table being captured.
Flags
4 bytes
Must be 0.
Fixed-length size
4 bytes
The number of bytes of data
in fixed-length columns in the
table.

GBase 8s数据库安装手册
南大通用数据技术股份有限公司
29
Fixed-length columns
4 bytes
The number of fixed-length
columns in the table being
captured.
A 0 indicates that there are
no fixed-length columns.
Variable-length columns
4 bytes
The number of
variable-length columns in
the table being captured.
A 0 indicates that there are
no variable-length columns.
Column names and data types
variable byte length
A comma-separated list of
column names and data types in
UTF-8 format. The column list
conforms to the syntax of the
column list in a CREATE TABLE
statement.
Names of any fixed-length
columns appear before names of
any variable-length columns.
The number of columns
equals the number of
fixed-length columns plus the
number of
variable-length columns.