数据百万下SQL性能测试指南方案_MySQL数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

数据百万下SQL性能测试指南方案

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

本篇关键词:SQLSQL教程
黑客防线网安网讯:百万数据下几种SQL性能测试 测试环境:90W,单条记录约3KB,数据库:MSSQL2005 测试前清除缓存
  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

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-19443-1.html
网站维护教程更新时间:2012-12-18 01:26:56  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer