SCN(System Change Number)是操作的序列号,引起数据变动的操作(DDL,DML等)都会引起SCN的变动。rename table
后SCN会增加。SCN可以通过information_schema.tables的scn列查询,最大值也可以查到(使用max函数)。
目前的主要作用:不同节点间同步数据时判断数据是否不一致的一个依据。
tableid是表的id,唯一标识。只有建表语句会申请新的tableid,rename table
后tableid不会变动。tableid可以通过information_schema.tables的table_id列查询,最大值也可以查到(使用max函数)。并发ddl时,有锁保护,不会引起不同的ddl得到同样的tableid。
GBase支持表及列设定comment备注信息,也支持这些信息的查询。
系统表information_schema.columns
、information_schema.tables
分别记录了列、表的comment信息。
查看方法:
- 通过
show create table
方式获取表的创建语句,查找comment信息; - 查询
information_schema.columns
、information_schema.tables
系统表,获取comment信息。
GBase集群的分布表在gnode的层以_n{number}的表名进行数据的存储和管理;
如果复制表以_n{number}的形式命名,就有可能造成gnode层的表冲突和混乱。
例如:复制表命名为mytab_n1,那么再创建分布表mytab时,集群节点就会出现mytab_n1表的冲突。
information_schema.views表中记录了视图的相关信息,如下:
select * from information_schema.views \G
*************************** 1. row ***************************
TABLE_CATALOG: NULL
TABLE_SCHEMA: testdb
TABLE_NAME: v1
VIEW_DEFINITION: select `testdb`.`t1`.`c1` AS `c1`,`testdb`.`t2`.`c2` AS `c2` from (`testdb`.`t1` left join `testdb`.`t2` on((`testdb`.`t1`.`c1` = `testdb`.`t2`.`c1`)))
CHECK_OPTION: NONE
IS_UPDATABLE: NO
DEFINER: root@%
SECURITY_TYPE: DEFINER
CHARACTER_SET_CLIENT: utf8
COLLATION_CONNECTION: utf8_general_ci
1 row in set (Elapsed: 00:00:00.00)