索引的memtable啥时候出现在memstore里

1:建表:
create table t10(id integer,name varchar(20),city varchar(20),primary key(id));
insert into t10 values(1,1,1),(2,2,2),(3,3,3)
2:创建索引
create index idx_t10_name on t10(name);
3:再插入数据:
insert into t10 values(4,4,4),(5,5,5),(6,6,6)

此时我查看__all_virtual_memstore_info里面只有表t10的memstore,没有索引的.
请问索引是必须合并后才有memstore?
查看sstable也是没查到索引的。

好像是我找错索引的tablet_id了。请问如何通过表名找到他下面的所有索引及索引的TABLET_ID啊。

在用户租户下可以通过以下sql查看,如果是sys租户,需要查询对应的CDB_*表。

1、如果是非分区表
select object_id from oceanbase.dba_objects where object_name=‘t3’; --假设返回 500440
select * from DBA_OB_TABLE_LOCATIONS where table_type=‘index’ and data_table_id=500440;

2、如果是分区表
select object_id from oceanbase.dba_objects where object_name=‘t_part2’ and data_object_id is null; – 假设返回 500443
select * from DBA_OB_TABLE_LOCATIONS where table_type=‘index’ and data_table_id=500443;

2 个赞

select * from CDB_OB_TABLE_LOCATIONS where tenant_id = xx and table_name like “%表名%”;
可以通过表名查tablet

1 个赞