化问题
--先看个例子
SQL> exec ctx_ddl.optimize_index(idx_auction_db1,FULL);
PL/SQL procedure successfully completed.
Elapsed: 00:16:16.77
索引优化相当的慢,200 万的数据建立context 索引需要不到5 分钟,而优化索引居然要16 分钟,这么慢
的优化速度对一个具有几亿表的数据是很难接受的的。刚开始我以为这是oracle 的一个bug,后来查到了
一些文档。Oracle10g 引进了rebuild 优化参数,速度还是很快的。
SQL> exec ctx_ddl.optimize_index(idx_auction_db1,rebuild) ;
PL/SQL procedure successfully completed.
3.10.14 事务查询
索引可能不是实时进行同步的,但是查询又要求实时的。
--更改索引为事务性,查询再找索引时还会dr$unindexed 表,把满足条件还未索引的记录找出来
alter index idx_auction_db1 rebuild parameters(replace metadata transactional)
例子:
select count(*) from table where contains(text, someword) > 0; -- 0 hits
insert into table values (someword);
select count(*) from table where contains(text, someword) > 0; -- 1 hit (the one we just
entered)
rollback;
select count(*) from table where contains(text, someword) > 0; -- 0 hit
仅仅是对某个session 启用
exec ctx_query.disable_transactional_query := TRUE;