最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
OracleRownum分頁(yè)改寫(xiě)

Oracle Rownum分頁(yè)改寫(xiě)

專(zhuān)注于為中小企業(yè)提供成都網(wǎng)站制作、做網(wǎng)站服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)港南免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上1000家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

---說(shuō)明:案例來(lái)自《   收獲,不止SQL優(yōu)化》

創(chuàng)建測(cè)試數(shù)據(jù):

---drop table test_rownum purge;

SQL >   create   table  test_rownum as   select   *   from  dba_objects ;

SQL >   select   count (*)   from  test_rownum ;   ---75793

SQL >   alter   session   set  statistics_level = all   ;

SQL >   set  linesize 1000

SQL >   set  pagesize 500

分頁(yè)寫(xiě)法 1 :

SQL >   select   *   from   ( select  t. *, rownum   as  rn   from  test_rownum t )  a where  a.rn >= 1   and  a.rn <= 10 ;

查看執(zhí)行計(jì)劃:

SQL >   select   *   from   table ( dbms_xplan.display_cursor ( null , null , 'allstats last' ));

Oracle Rownum分頁(yè)改寫(xiě)

分頁(yè)寫(xiě)法 2 :

SQL >   select   *   from   ( select  t. *, rownum   as  rn   from  test_rownum t where   rownum <= 10 )  a where  a.rn >= 1 ;   

查看執(zhí)行計(jì)劃:

SQL >   select   *   from   table ( dbms_xplan.display_cursor ( null , null , 'allstats last' ));

Oracle Rownum分頁(yè)改寫(xiě)

總結(jié): 寫(xiě)法1的buffer為1080,掃描真實(shí)數(shù)據(jù)為75793條,寫(xiě)法2的buffer只有5,掃描真實(shí)數(shù)據(jù)為10條,性能較寫(xiě)法1有很大改善。

歡迎關(guān)注我的微信公眾號(hào)"IT小Chen",共同學(xué)習(xí),共同成長(zhǎng)!??!

Oracle Rownum分頁(yè)改寫(xiě)


標(biāo)題名稱(chēng):OracleRownum分頁(yè)改寫(xiě)
本文路徑:http://fisionsoft.com.cn/article/pdgdgs.html