爱问知识人 爱问教育 医院库

Like如何优化?

首页

Like如何优化?

Like如何优化?

提交回答

全部答案

    2017-07-26 10:17:09
  •   1。尽量不要使用 like '%。。%'
    2。对于 like '。。%。。' (不以 % 开头),Oracle可以应用 colunm上的index
    3。对于 like '%。。。' 的 (不以 % 结尾),可以利用reverse + function index 的形式,变化成 like '。
      。%' 代码: -- '建测试表和Index,注意,重点在于带reverse的function index。同时,一定要使用CBO才行……sys@mescp> select reverse('123') from dual;REVERSE('123')--------------------------------3211 row selected。
      sys@mescp> create table test_like as select object_id,object_name from dba_objects;Table created。sys@mescp> create index test_like__name on test_like(object_name);Index created。
      sys@mescp> create index test_like__name_reverse on test_like(reverse(object_name));Index created。sys@mescp> analyze table test_like compute statistics for table for all indexes;Table analyzed。
      sys@mescp> set autotrace trace exp。

    H***

    2017-07-26 10:17:09

类似问题

换一换

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):