国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

同條SQL,有時(shí)buffer get會暴增

2024-07-21 02:33:21
字體:
供稿:網(wǎng)友
同樣一條SQL ,有的時(shí)候 buffer get 會暴增?! Oracle_L 中有人提了一個(gè)這樣的問題: I have a batch PRocess that executes individual transactions, normally a transaccion e.g. a simple select would take 8-10 buffer gets but in the batch processing it takes 45 buffer gets.
Zhu Chao (Chao_ping,這家伙現(xiàn)在一篇文章都不寫,只能從郵件列表里看到他的蹤跡) 給了一個(gè)解釋:the job is processing some very hot blocks. So it always need to reverse back and find the CR block from buffer, so it will generate some more buffer gets for that execution.
假如是因?yàn)镠ot Block 的原因,那么主要的癥狀應(yīng)該是 Wait. 假如這個(gè) SQL 在運(yùn)行的時(shí)候數(shù)據(jù)已經(jīng)發(fā)生了變化,那么為了維持一致性不可避免的會生成回滾,所以這個(gè)解釋更為準(zhǔn)確一些:If a query does a consistent get on a block that has been changed since that query began or that had uncommitted changes at the time that that query began, then it is necessary to rollback those changes for read consistency. The consistent changes statistics counts the number changes rolled back. However, most consistent gets do not require any sUCh rollback, and so it is normal for the number of consistent gets to be much greater than the number of consistent changes. This is reflected in the no work - consistent read gets statistic
我們不妨來做個(gè)例子.假定我們現(xiàn)在有兩個(gè)session,首先在第一個(gè)窗口做如下操作
SQL> create table t as select * from all_objects where rownum<1001;Table created.SQL> select owner,object_name from t where owner='SYS' for update;
在第二個(gè)Session,進(jìn)行一個(gè)簡單的統(tǒng)計(jì):SQL> SELECT COUNT(*) FROM T;......Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
       1055  consistent gets
          0  physical reads
       1352  redo size
        379  bytes sent via SQL*Net to client
        504  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed注重到產(chǎn)生了 1055 個(gè)一致讀.接著我們r(jià)ollback 第一個(gè)Session ,然后在第二個(gè)Session中繼續(xù)這個(gè)統(tǒng)計(jì):SQL> SELECT COUNT(*) FROM T;
.....Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
         29  consistent gets
          0  physical reads
          0  redo size
        379  bytes sent via SQL*Net to client
        504  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
只有 29 個(gè)一致讀了.驗(yàn)證了前面的解釋.

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿图什市| 泰州市| 特克斯县| 彭山县| 凯里市| 东阳市| 将乐县| 汉沽区| 镇远县| 六盘水市| 嘉定区| 台东县| 阿瓦提县| 彰化县| 昆明市| 仁寿县| 上犹县| 丹阳市| 巴南区| 宜章县| 武宁县| 岐山县| 静海县| 孝义市| 海门市| 罗平县| 安西县| 宁晋县| 金溪县| 罗甸县| 乐至县| 南召县| 泰宁县| 墨江| 紫阳县| 邓州市| 尼玛县| 昆山市| 浦东新区| 上虞市| 巢湖市|