示例说明consistent read,current read,logical read,phicical read的概念及关系

.示例说明consistentread,current read,logical read,physical read的概念及关系

Logical read:所谓逻辑读,就是从内存中读取数据块,包含current read  consistent read

current read:属于Oracle版本读取方式的一种机制,就是说当进行DML操作时,我们需要获取数据块最新的状态,只对最新状态进行操作,操作期间锁定数据行。

consistent read:当进行select查询时,我们需要获取查询那一刻数据块状态,不管查询了多长时间,我们只要查询那一瞬间的结果,如果查询期间数据块被修改,那么我们就去undo segment读取旧映像来呈现。

公式:logicalread=db block gets(current read) + consistent gets(consistent read)

Physical read:所谓物理读,就是从磁盘中读取数据块

如果想了解更多的currentread  consistent read的信息请参考如下链接

Oracleundo我们需要掌握什么》 第五小题示例分别说明什么是consistentreadcurrentread?

http://space.itpub.net/26686207/viewspace-757488

LEO1@LEO1> drop table leo2 purge;                      清空环境

Table dropped.

LEO1@LEO1> create table leo2 as select * fromdba_objects;     创建leo2

Table created.

LEO1@LEO1> set autotrace traceonly

LEO1@LEO1> select count(*) from leo2;                     查看一下SQL语句统计信息

Statistics

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

         28  recursivecalls

          0  db block gets

       1100  consistent gets      逻辑读中一致性读,发生了1100次(从内存中读取数据块)

       1025  physical reads      物理读发生了1025次(从磁盘中读取数据块)

          0  redo size

        528  bytes sentvia SQL*Net to client

        524  bytes receivedvia SQL*Net from client

          2  SQL*Netroundtrips to/from client

          0  sorts(memory)

          0  sorts (disk)

          1  rowsprocessed

逻辑读与物理读关系:逻辑读触发物理读的发生,因为oracle默认数据块在内存中,如果发现块不在内存里,就会触发物理读从磁盘上读取数据块到内存,在进行下面的逻辑读。

有物理读必有逻辑读,有逻辑读不一定有物理读,看看下面的样子

LEO1@LEO1> select count(*) from leo2;

Statistics

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

          0  recursivecalls

          0  db block gets

       1030  consistentgets           只有逻辑读1030

          0  physicalreads            没有物理读

          0  redo size

        528  bytes sentvia SQL*Net to client

        524  bytesreceived via SQL*Net from client

          2  SQL*Netroundtrips to/from client

          0  sorts(memory)

          0  sorts (disk)

          1  rowsprocessed

原因:数据块现在已经全部缓存到内存中了,我们从内存中读取块即可,不用再从磁盘中读取块了,自然就没有物理读。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
NAND flash memory is widely used in electronic devices such as smartphones, tablets, and solid-state drives (SSDs). During the reading process, errors can occur due to various factors such as noise and interference. To improve the reliability of data reading, NAND flash memory controllers implement two techniques: re-read and read retry. Re-read is a technique where the memory controller reads the same data multiple times and compares the results to detect errors. If the results are inconsistent, the controller will perform another read operation until it gets a consistent result. Re-read is a simple and effective technique to detect and correct errors. Read retry is a more advanced technique that involves adjusting the read parameters of the memory controller based on the characteristics of the NAND flash memory. Read parameters such as read voltage and read latency can be adjusted to improve the reliability of data reading. Read retry requires more complex algorithms and can improve the performance of the NAND flash memory in high-noise environments. In summary, re-read and read retry are two techniques used by NAND flash memory controllers to improve the reliability of data reading. Re-read is a simple and effective technique that reads the same data multiple times and compares the results to detect errors. Read retry is a more advanced technique that adjusts the read parameters of the memory controller based on the characteristics of the NAND flash memory to improve the reliability of data reading.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值