• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

关于db_block_size的理解和实验

mysql 搞代码 4年前 (2022-01-09) 21次浏览 已收录 0个评论

关于对db_block_gets的理解与实验 实验 一、 自己手动创建的小表 创建一个区大小为 40k SYS@ORCLshow parameter db_block_size NAME TYPE VALUE ———————————— ———– —————————— db_block_size integer 819

关于对db_block_gets的理解与实验

实验

一、 自己手动创建的小表

创建一个区大小为 40k
SYS@ORCL>show parameter db_block_size

NAME TYPE VALUE
———————————— ———– ——————————
db_block_size integer 8192

SYS@ORCL>create tablespace tyger1 datafile '/u01/app/oracle/oradata/ORCL/tyger1.dbf' size 10m
2 extent management local uniform size 40k;

Tablespace created.

SYS@ORCL>create table test_db1(x int) tablespace tyger1;

Table created.

SYS@ORCL>set autotrace on
SYS@ORCL>insert into test_db1 values(1);

1 row created.

Execution Plan
———————————————————-
————————————————————————-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
————————————————————————-
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
————————————————-本文来源gaodai#ma#com搞@代~码^网+————————
Statistics
———————————————————-
1 recursive calls
19 db block gets
1 consistent gets
3 physical reads
964 redo size
675 bytes sent via SQL*Net to client
562 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed

SYS@ORCL>insert into test_db1 values(2);

1 row created.

Execution Plan
———————————————————-

————————————————————————-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
————————————————————————-
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
————————————————————————-

Statistics
———————————————————-
1 recursive calls
3 db block gets
1 consistent gets
0 physical reads
244 redo size
675 bytes sent via SQL*Net to client
562 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed

2. 创建一个区 大小为80k
SYS@ORCL>create tablespace tyger2 datafile '/u01/app/oracle/oradata/ORCL/tyger2.dbf' size 10m
2 extent management local uniform size 80k;

Tablespace created.

SYS@ORCL>create table test_db2(x int) tablespace tyger2;

Table created.

SYS@ORCL>insert into test_db2 values(1);

1 row created.

Execution Plan
———————————————————-

————————————————————————-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
————————————————————————-
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
————————————————————————-

Statistics
———————————————————-
1 recursive calls
29 db block gets
1 consistent gets
28 physical reads
1364 redo size
675 bytes sent via SQL*Net to client
562 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed

SYS@ORCL>insert into test_db2 values(2);

1 row created.

Execution Plan
———————————————————-

————————————————————————-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
————————————————————————-
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
————————————————————————-

Statistics
———————————————————-
1 recursive calls
3 db block gets
1 consistent gets
0 physical reads
288 redo size
677 bytes sent via SQL*Net to client
562 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:关于db_block_size的理解和实验

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址