• λ我爱Aspx >> Asp.Net >> 如何加速网站的速度
  • 如何加速网站的速度

  • :未知  Դ:internet  :2007-5-20 16:39:54  ؼ:
  • 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防注代码