1。尽量不要使用 like "%%"2。对于 like "%" (不以 % 开头),Oracle可以应用 colunm上的index3。对于 like "%…" 的 (不以 % 结尾),可以利用reverse + function index 的形式,变化成 like "%"建测试表和Index,注意,重点在于带reverse的function index。同时,一定要使用CBO才行create table test_like as select object_id,object_name from dba_objects;-------建立测试表create index test_like__name on test_like(object_name);------建立索引create index test_like__name_reverse on test_like(reverse(object_name));------建立反向索引analyze table test_like compute statistics for table for all indexes;------对表进行分析都过SQLPLUS连接到数据,一定是SQLPLUS,因为下面有写命令在PLSQL的命令行中不被支持;set autotrace trace exp-----设定SQL跟踪set linesize 2000-------设定输出宽度select * from test_like where object_name like "AS%";使用了索引select * from test_like where object_name like "%S";未使用索引select * from test_like where reverse(object_name)like reverse("%AS");使用了索引Oracle系统变量函数简介Oracle分析函数学习相关资讯 Oracle教程