表对象的标识

表对象标识

kingbase中表作为数据库对象具有一个系统内部的唯一标识符,这个标识符被称为oid(对象标识符),它是kingbase用来在整个数据集群中唯一地标识每个数据库对象的一个字段。对于表来说,其OID可以在系统目录表sys_class中找到。

oid是否会变化

一般情况下,对表进行dml操作,表的oid是不会发生变化的。但是如果对表进行ddl操作,表oid是否会变化呢?接下来我们测试一下。

复制代码
test=# create table test_oid (id int);
CREATE TABLE
test=# select oid from sys_class where relname ='test_oid' and relkind='r';
  oid
-------
 16390
 test=# alter table test_oid rename TO test_oid_new;
ALTER TABLE
test=# select oid from sys_class where relname ='test_oid_new' and relkind='r';
  oid
-------
 16390
 test=# truncate test_oid_new ;
TRUNCATE TABLE
test=# select oid from sys_class where relname ='test_oid_new' and relkind='r';
  oid
-------
 16390
 test=# drop table test_oid_new ;
DROP TABLE
test=# create table test_oid (id int);
CREATE TABLE
test=# select oid from sys_class where relname ='test_oid' and relkind='r';
  oid
-------
 16395

通过测试,表的oid只有在drop后重建回发生变化,truncate table oid不会改变

mysql 没有类似kingbase oid或pg oid类似的对象标识。

oracle 中表对象的标识由object_id和data_object_id,truncate操作object_id不会发生变化,data_object_id可能会发生变化。

相关推荐
最懒的菜鸟1 小时前
redis缓存击穿
数据库·redis·缓存
qq_404265831 小时前
用Python批量处理Excel和CSV文件
jvm·数据库·python
人间打气筒(Ada)2 小时前
mysql数据库之DDL、DML
运维·数据库·sql·mysql·dba·dml·dql
代码派2 小时前
信创迁移“不敢切”的最后一公里:数据一致性校验怎么做才算够?
数据库·数据库开发·dba·etl工程师·数据库管理工具·信创数据库·信创迁移
qq_418101772 小时前
使用Scikit-learn进行机器学习模型评估
jvm·数据库·python
熙胤2 小时前
PostgreSQL 向量扩展插件pgvector安装和使用
数据库·postgresql
牢七3 小时前
baijiacms-master 审计
数据库
数据知道3 小时前
MongoDB聚合管道性能优化:阶段重排与内存使用控制策略
数据库·mongodb·性能优化
Predestination王瀞潞3 小时前
3.3-mapper映射文件+数据库实体关系设计:数据库实体关系设计、SQL 连接查询及MyBatis 多表映射
数据库·sql·mybatis
Mr.徐大人ゞ3 小时前
2-3.pg核心功能之索引特色
postgresql