Oracle 物化视图快速刷新对性能的影响(2)

Statistics
----------------------------------------------------------
          8  recursive calls
      10233  db block gets
        548  consistent gets
        145  physical reads
    2725824  redo size
        863  bytes sent via SQL*Net to client
        858  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
      9999  rows processed
#更新9999笔记录,Redolog产生量957056,耗时00:00:00.13
SQL> update tb_rowid set object_id=2 where rownum<10000;

9999 rows updated.

Commit complete.
Elapsed: 00:00:00.13

Statistics
----------------------------------------------------------
          8  recursive calls
        294  db block gets
        548  consistent gets
          0  physical reads
    957056  redo size
        864  bytes sent via SQL*Net to client
        858  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
      9999  rows processed
#更新9999笔记录,Redolog产生量961224,耗时00:00:00.14
SQL> update tb_rowid set object_id=2 where rownum<10000;

9999 rows updated.

Commit complete.
Elapsed: 00:00:00.14

Statistics
----------------------------------------------------------
          1  recursive calls
        294  db block gets
        489  consistent gets
          0  physical reads
    961224  redo size
        864  bytes sent via SQL*Net to client
        858  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
      9999  rows processed

#表tb_rowid上有物化视图日志
#建物化视图日志
SQL> create  materialized view log on tb_rowid with rowid including new values;

Materialized view log created.

Elapsed: 00:00:00.34

#插入9999笔记录,Redolog产生量10905808,耗时00:00:03.73
SQL> insert into tb_rowid select * from tb_rowid where rownum<10000;

9999 rows created.

Commit complete.
Elapsed: 00:00:03.73

Statistics
----------------------------------------------------------
        176  recursive calls
      43316  db block gets
      1227  consistent gets
        104  physical reads
  10905808  redo size
        862  bytes sent via SQL*Net to client
        870  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
        14  sorts (memory)
          0  sorts (disk)
      9999  rows processed

#插入9999笔记录,Redolog产生量11015104,耗时00:00:04.03
SQL> insert into tb_rowid select * from tb_rowid where rownum<10000;

9999 rows created.

Commit complete.
Elapsed: 00:00:04.03

Statistics
----------------------------------------------------------
        32  recursive calls
      42863  db block gets
      6438  consistent gets
          2  physical reads
  11015104  redo size
        865  bytes sent via SQL*Net to client
        870  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
      9999  rows processed
#删除9999笔记录,Redolog产生量11019692,耗时00:00:03.88
SQL> delete tb_rowid where rownum<10000;

9999 rows deleted.

Commit complete.
Elapsed: 00:00:03.88

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ce08f700a5068c6520f228109fbcfcf8.html