对于内容很多的时候clob打字段模糊查询很慢,整理一个小方法:

1,在查询的列上建索引

        2,对于要查询的clob字段使用一下语句创建索引

 

  CREATE INDEX idx_zs_info_note

ON zs_info(note)

INDEXTYPE is CTXSYS.CONTEXT;  
 
 
3.查询的时候对于clob字段使用如下方法,不要使用like
 select * frominfo where contains(note,'XXXXX')>0  order by id desc 
 
还有一种方法可以使用dbms_lob.instr(note,'XXXX')>0 但是没有上面的快

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
猜你喜欢
  • 2021-05-19
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案