码迷,mamicode.com
首页 > 数据库 > 详细

数据库全表扫描的SQL种类

时间:2017-08-01 19:18:06      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:数据   返回   使用   upper   需要   content   label   全表扫描   and   

1.所查询的表的条件列没有索引;

2.需要返回所有的行;

3.对索引主列有条件限制,但是使用了函数,则Oracle 使用全表扫描,如:

where  upper(city)=’TOKYO’; 

这样的语句不会使用索引方法。所以就只能全表扫描。

4.带有 is null 和is not null 及 != 等子句。如:

. . . where  city is  null ;

. . . where city is  not  null;

. . . where  city != ‘TOKYO’;

5.带like  并使用’%’这样的语句就使用全表扫描;

 

数据库全表扫描的SQL种类

标签:数据   返回   使用   upper   需要   content   label   全表扫描   and   

原文地址:http://www.cnblogs.com/fushou/p/7269715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!