我的表有两个字段
cols1 cols2 都是clob类型
我现在都单独建立了索引执行语句:select * from table where contains(cols1,'xxxx')>0 or contains(cols2,'xxxx')>0;
1000W查询非常快 现在我想实现:
select * from table where contains(cols1||' '||cols2,'xxxx')>0;
这样执行是无法通过的,如果想实现这种查询效果。不知道该如何创建索引?
cols1 cols2 都是clob类型
我现在都单独建立了索引执行语句:select * from table where contains(cols1,'xxxx')>0 or contains(cols2,'xxxx')>0;
1000W查询非常快 现在我想实现:
select * from table where contains(cols1||' '||cols2,'xxxx')>0;
这样执行是无法通过的,如果想实现这种查询效果。不知道该如何创建索引?
create index idx1 on tableA( cols1||' '||cols2 ) indextype is CTXSYS.CONTEXT;
select * from table where contains(cols,'xxxx')>0 or contains(cols2,'xxxx')>0; 而且这个语句比你的语句(select * from table where contains(cols1||' '||cols2,'xxxx')>0; )
还要快!