Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

0

好友

6

主题
1#
发表于 2014-11-20 10:19:35 | 查看: 3501| 回复: 3

10:12:39 >SELECT segment_name, segment_type, bytes FROM user_segments WHERE segment_name = 'T';

SEGMENT_NA SEGMENT_TYPE            BYTES
---------- ------------------ ----------
T          TABLE                38797312

10:10:49 >SELECT * FROM t;

365824 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 1601196873

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      | 11432 |   948K|    44   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| T    | 11432 |   948K|    44   (0)| 00:00:01 |
--------------------------------------------------------------------------


Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
      28733  consistent gets
       4641  physical reads
          0  redo size
   37710983  bytes sent via SQL*Net to client
     268737  bytes received via SQL*Net from client
      24390  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
     365824  rows processed

10:10:56 >SELECT * FROM t;

365824 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 1601196873

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      | 11432 |   948K|    44   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| T    | 11432 |   948K|    44   (0)| 00:00:01 |
--------------------------------------------------------------------------


Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
      28733  consistent gets
          0  physical reads
          0  redo size
   37710983  bytes sent via SQL*Net to client
     268737  bytes received via SQL*Net from client
      24390  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
     365824  rows processed
================================================

请教一下:这张T表只有37M的大小,第一次全表扫描时物理读36M左右,没有问题,但是逻辑读为什么确实200多M,第二次物理读为零,逻辑读依然为200多M,按理来说T表只有37M,那么逻辑读也应该只有37M左右才对啊,多出来的逻辑读是出在哪里啊?

谢谢!
2#
发表于 2014-11-20 10:23:38
顶一下,别沉了!

回复 只看该作者 道具 举报

3#
发表于 2014-11-20 11:31:45
show arraysize

回复 只看该作者 道具 举报

4#
发表于 2014-11-20 11:40:15
FYI

2. Arraysize
If the application is using large amount of data, consider increasing the arraysize in the application.  If small arraysize is used to fetch the data, then the query will use multiple fetch calls, each of these will wait for the ‘SQL*net message to client’ event. With a small arraysize and a large amount of data, the number of waits can become significant.
If running SQL from sqlplus, the arraysize can be increased using the sqlplus “set” command:
set arraysize 1000
From the raw 10046 tracefile, the fetch buffer size or the arraysize can be seen from the r (rows) of the fetch line:
FETCH #18446744071490060104:c=0,e=17086,p=2,cr=3,cu=0,mis=0,r=1,dep=1,og=4,plh=872636971,tim=28473178755694
Here the r=1 is indicating arraysize of 1.  1 may be too low; so try increasing it if the wait for ‘SQL*net message to client’ events is large.
There is more information on arraysize and how to increase it in different applications in the following document:
Document 1419023.1 Row Prefetching and its impact on logical reads and fetch calls

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-20 22:25 , Processed in 0.047639 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569