我爱Aspx >> Asp.Net >> 如何加速网站的速度19990901 and place in (BJ,SH) (27秒)
---- 分析:
----date上有大量的重复值,在非群集索引下,数据在物理上随机存放在数据页上,在
范围查找时,必须执行一次表扫描才能找到这一范围内的全部行。
---- 2.在date上的一个群集索引
select count(*) from record where date >
19991201 and date < 19991214 and amount >
2000 (14秒)
select date,sum(amount) from record group by date
(28秒)
select count(*) from record where date >
19990901 and place in (BJ,SH)(14秒)
---- 分析:
---- 在群集索引下,数据在物理上按顺序在数据页上,重复值也排列在一起,因而在范
围查找时,可以先找到这个范围的起末点,且只在这个范围内扫描数据页,避免了大范
围扫描,提高了查询速度。
---- 3.在place,date,amount上的组合索引
select count(*) from record where date >
19991201 and date < 19991214 and amount >
2000 (26秒)
select date,sum(amount) from record group by date
(27秒)
select count(*) from record where date >
19990901 and place in (BJ, SH)(< 1秒)
Ҷƪл˵?
万能asp防注代码[05-20]
WEB编程开发常用的代码[05-20]
仅用XSL和ASP实现分页功能(代码)[05-20]
购物推车设计8个方法[05-20]
Asp自定义函数参考[05-20]
ASP数据库连接[05-20]
ASP中使用存储过程[05-20]
ASP与数据库连接的问题[05-20]
asp溢出漏洞[05-20]
ASP连动下拉列表从数据库读取[05-20]