–编辑kingbase.conf,设置系统表可编辑后,重启数据库实例
allow_system_table_mods=on
allow_system_table_dml=on
–创建测试表
drop table if exists t1;
create table t1 as select generate_series(1,2000) as id,‘aa’ as name;
–创建索引
create index idx1 on t1(id);
–默认执行计划
explain analyze select * from t1 where id =1500; --走索引
–设置索引不可见
select oid from sys_class where relname=‘t1’;
update sys_index set indisvalid =‘f’::boolean where indrelid = 17363;
–索引不可见后查看执行计划
explain analyze select * from t1 where id =1500; --不走索引
06-09
09-14
724