_MySQL数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

作者:黑客防线网安SQL教程网 来源:黑客防线网安SQL教程网 浏览次数:0

本篇关键词:SQLSQL教程
  1. DBCC FREEPROCCACHE
  2. DBCC DROPCLEANBUFFERS

一、翻页性能测试

1、Top

  1. select top 10 *
  2. from message where id not in
  3. (select top 20 id frommessage where classid=77 order by id desc )
  4. and classid=77 order by id desc

2、Max/Top

  1. select top 10 *
  2. from message where id <(select min(id) from messagewhere id in(select top 20 id
  3. from message where classid=77 order by iddesc) )
  4. and classid=77 order by id desc

3、row_number

  1. select top 10 * from
  2. (select row_number()over(order by id desc) rownumber,*from
  3. message where classid=77)a where classid=77 and rownumber>20

MsSql翻页性能测试

ID列索引

Top

Max/Top

row_number()

无索引

cpu

reads

duration

0

893

65

cpu

reads

duration

0

590

70

cpu

reads

duration

0

512

67

聚焦索引

cpu

reads

duration

0

37

66

cpu

reads

duration

0

98

64

cpu

reads

duration

0

28

67

非聚焦索引

cpu

reads

duration

0

895

63

cpu

reads

duration

0

592

66

cpu

reads

duration

0

514

66


    希望这篇的文章能够对您有所帮助,如果您觉得这篇网站维护教程有用的话,别忘了推荐给您的朋友哦!如果您有好的经验方法,不妨拿出来和大家一起分享:假如每个人都拿出一个经验,那么我们都将额外的获取一堆他人的经验。
请记住本站永久域名:(黑客防线网安服务器维护方案维护基地)Www.Rongsen.Com.Cn
    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-19443-1.html
网站维护教程更新时间:2012-12-18 01:26:56  【打印此页】  【关闭
0
顶一下
0
踩一下
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer