理清全表扫描和高水位,行预取的关系(二)

2014-11-24 09:21:11 · 作者: · 浏览: 1
---
50323 712 71 --T表每个块平均有71行
hr@ORCL> set autot trace stat
hr@ORCL> set arraysize 2
hr@ORCL> select * from t;
50323 rows selected.
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
25532 consistent gets
0 physical reads
0 redo size
8236771 bytes sent via SQL*Net to client
277156 bytes received via SQL*Net from client
25163 SQL*Net roundtrips to/from client --[返回行的总数/arraysize]+1
0 sorts (memory)
0 sorts (disk)
50323 rows processed
hr@ORCL> set arraysize 3000
hr@ORCL> select * from t;
50323 rows selected.
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
714 consistent gets
0 physical reads
0 redo size
4967955 bytes sent via SQL*Net to client
561 bytes received via SQL*Net from client
18 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
50323 rows processed
当行预取设定为2,逻辑读的数量(25532)大概是行数(50323)的一半
当行预取设定比平均每个块中的行数(71)都要高,逻辑读的数量(714)和总块数(712)接近