• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 百萬級數據下幾種SQL性能測試

    發表于:2012-11-29來源:博客園作者:East神奇點擊數: 標簽:性能測試
    百萬數據下幾種SQL性能測試. 今天閑來學習了一下SQL性能優化方面的知識,有以下學習收獲,歡迎大家指點。 測試環境:90W,單條記錄約3KB,數據庫:MSSQL2005 測試前清除緩存

      今天閑來學習了一下SQL性能優化方面的知識,有以下學習收獲,歡迎大家指點。

      測試環境:90W,單條記錄約3KB,數據庫:MSSQL2005

      測試前清除緩存

      DBCC FREEPROCCACHE

      DBCC DROPCLEANBUFFERS

      一、翻頁性能測試

      1、Top

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

      2、Max/Top

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

      3、row_number

      select top 10 * from (select row_number()over(order by id desc) rownumber,*from 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.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>