Note
This view is introduced since OceanBase Database V4.3.0.
Purpose
The DBA_MVREF_CHANGE_STATS view displays the refresh statistics of materialized views. The statistics show the data changes on the base tables associated with each materialized view refresh, as well as the information required to load the changed data.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TBL_OWNER | varchar(128) | NO | The owner of the base table. |
| TBL_NAME | varchar(128) | NO | The name of the base table. |
| MV_OWNER | varchar(128) | NO | The owner of the materialized view. |
| MV_NAME | varchar(128) | NO | The name of the materialized view. |
| REFRESH_ID | bigint(20) | NO | The ID of the refresh. |
| NUM_ROWS_INS | bigint(20) | YES | The number of rows inserted. |
| NUM_ROWS_UPD | bigint(20) | YES | The number of rows updated. |
| NUM_ROWS_DEL | bigint(20) | YES | The number of rows deleted. |
| NUM_ROWS_DL_INS | bigint(1) | NO | The number of rows inserted by using the Direct-load INSERT statement.
NoteThis column is used only for compatibility and is |
| PMOPS_OCCURRED | varchar(1) | NO | Indicates whether a partition maintenance operation (PMOP) has been performed. Valid values:
NoteThis column is used only for compatibility and is |
| PMOP_DETAILS | text | NO | The detailed information about the PMOPs, in the following formats:
NoteThis column is used only for compatibility and is |
| NUM_ROWS | bigint(20) | YES | The number of rows in the base table when the refresh starts. |
Sample query
obclient [test_db]> SELECT * FROM oceanbase.DBA_MVREF_CHANGE_STATS;
The query result is as follows:
+-----------+-----------+----------+---------------+------------+--------------+--------------+--------------+-----------------+----------------+--------------+----------+
| TBL_OWNER | TBL_NAME | MV_OWNER | MV_NAME | REFRESH_ID | NUM_ROWS_INS | NUM_ROWS_UPD | NUM_ROWS_DEL | NUM_ROWS_DL_INS | PMOPS_OCCURRED | PMOP_DETAILS | NUM_ROWS |
+-----------+-----------+----------+---------------+------------+--------------+--------------+--------------+-----------------+----------------+--------------+----------+
| test_db | test_tbl1 | test_db | mv1_tbl1_tbl2 | 64670 | 0 | 0 | 0 | 0 | N | NULL | 0 |
| test_db | test_tbl2 | test_db | mv1_tbl1_tbl2 | 64670 | 0 | 0 | 0 | 0 | N | NULL | 0 |
| test_db | test_tbl1 | test_db | mv2_tbl1_tbl2 | 64672 | 0 | 0 | 0 | 0 | N | NULL | 0 |
| test_db | test_tbl2 | test_db | mv2_tbl1_tbl2 | 64672 | 0 | 0 | 0 | 0 | N | NULL | 0 |
+-----------+-----------+----------+---------------+------------+--------------+--------------+--------------+-----------------+----------------+--------------+----------+
4 rows in set (0.029 sec)