使用索引的误区之二:使用了 和 != 操作符,导致查询不使用索引[4]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 lunar2000 的 blog

 

plan_table_output

--------------------------------------------------------------------------------

--------------------------------------------------------------------

| id  | operation            |  name       | rows  | bytes | cost  |

--------------------------------------------------------------------

|   0 | select statement     |             |       |       |       |

|*  1 |  index range scan    | emp_id1     |       |       |       |

--------------------------------------------------------------------

predicate information (identified by operation id):

---------------------------------------------------

   1 - access("emp"."empno"<=10)

       filter("emp"."empno"<=10 and "emp"."ename"<>'rich')

note: rule based optimization

 

15 rows selected

本文关键:使用索引的误区之二:使用了 和 != 操作符,导致查询不使用索引
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top