mysql 单块读 多块读_10046确认多块读无法跨区

本文通过插入数据和查询EXTENT分配来构建环境,展示了如何利用10046事件跟踪观察MySQL的单块读和多块读行为。通过对查询的分析,揭示了数据库在不同场景下如何读取数据块,并提供了部分读取的详细等待事件。
摘要由CSDN通过智能技术生成

1)环境构建,使用笨拙的办法,不断insert,查询extent分配

SQL> insert into scott.e values(8,8,8,8);

SQL> insert into scott.e values(9,9,9,9);

SQL> insert into scott.e values(10,10,10,10);

SQL> insert into scott.e values(11,11,11,11);

SQL> insert into scott.e values(12,12,12,12);

SQL> r

1 select tablespace_name,file_id,extent_id,block_id,

2 bytes/1024 bytes_k,blocks from dba_extents

3 where owner='SCOTT' and segment_name='E'

4*

TABLESPACE_NAM FILE_ID EXTENT_ID BLOCK_ID BYTES_K BLOCKS

-------------- ---------- ---------- ---------- ---------- ----------

USERS 4 0 1768 64 8

USERS 4 1 1776 64 8

USERS 4 2 1784 64 8

USERS 4 3 3200 64 8  --终于新扩建一个区

SQL> select rowid from scott.e where id like '%12%';

ROWID

------------------

AAAS5RAAEAAAAyGAAA

select rowid,

dbms_rowid.rowid_object(rowid) "objct",

dbms_rowid.rowid_relative_fno(rowid) "file",

dbms_rowid.rowid_block_number(rowid) "block",

dbms_rowid.rowid_row_number(rowid) "row"

from scott.e;

ROWID objct file block row

------------------ ---------- ---------- ---------- ----------

AAAS5RAAEAAAAbsAAA 77393 4 1772 0

AAAS5RAAEAAAAbvAAA 77393 4 1775 0

AAAS5RAAEAAAAbwAAA 77393 4 1776 0

AAAS5RAAEAAAAbxAAA 77393 4 1777 0

AAAS5RAAEAAAAb0AAA 77393 4 1780 0

AAAS5RAAEAAAAb2AAA 77393 4 1782 0

AAAS5RAAEAAAAb7AAA 77393 4 1787 0

AAAS5RAAEAAAAb9AAA 77393 4 1789 0

AAAS5RAAEAAAAb/AAA 77393 4 1791 0

AAAS5RAAEAAAAb/AAB 77393 4 1791 1

AAAS5RAAEAAAAb/AAC 77393 4 1791 2

AAAS5RAAEAAAAyGAAA 77393 4 3206 0 ---

12 rows selected.

2)10046跟踪

SQL> alter system flush buffer_cache;

SQL> alter session set events '10046 trace name context forever,level 12';

Session altered.

SQL> select count(*) from scott.e;

COUNT(*)

----------

12

SQL> alter session set events '10046 trace name context off';

Session altered.

jx1:/u01/app/oracle/diag/rdbms/jx/jx1/trace$ cat jx1_ora_55917.trc|grep read

Redo thread mounted by this instance: 1

WAIT #139784104305960: nam='db file sequential read' ela= 15423 file#=4 block#=1770 blocks=1 obj#=77393 tim=1545605262033100 (OK)

WAIT #139784104305960: nam='db file scattered read' ela= 650 file#=4 block#=1771 blocks=5 obj#=77393 tim=1545605262034068

WAIT #139784104305960: nam='db file scattered read' ela= 708 file#=4 block#=1776 blocks=8 obj#=77393 tim=1545605262035050

WAIT #139784104305960: nam='db file scattered read' ela= 678 file#=4 block#=1785 blocks=7 obj#=77393 tim=1545605262036010

WAIT #139784104305960: nam='db file scattered read' ela= 12389 file#=4 block#=3200 blocks=8 obj#=77393 tim=1545605262048744

原谅我容易满足,得到单块读现象后,我现在停止了脚步,如有兴趣的朋友,可以继续研究,这些块都是什么对象,为什么这读取,是否存在什么规则。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值