我的表有两个字段
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;
这样执行是无法通过的,如果想实现这种查询效果。不知道该如何创建索引?

解决方案 »

  1.   

    试试这个:
    create index idx1 on tableA( cols1||' '||cols2 ) indextype is CTXSYS.CONTEXT;
      

  2.   

    既然两个字段都建立了索引,那可以换一个办法查询,从sql语句入手
    select * from table where contains(cols,'xxxx')>0 or contains(cols2,'xxxx')>0; 而且这个语句比你的语句(select * from table where contains(cols1||' '||cols2,'xxxx')>0; )
    还要快!