OceanBase Database optimizer supports three methods for collecting statistics: manual collection, automatic collection, and online collection. Corresponding views are provided for querying the collected statistics.
Table-level statistics
OceanBase Database provides views for querying the collection status of table-level statistics:
MySQL-compatible mode
Oracle-compatible mode
| View name |
Description |
| oceanbase.DBA_TAB_STATISTICS |
Used to query table-level statistics. |
| View name |
Description |
|
|
Used to query table-level statistics. |
| sys.ALL_VIRTUAL_TABLE_STAT_REAL_AGENT |
Used to query table-level statistics through a proxy table. |
Column-level statistics
OceanBase Database provides views for querying the collection status of column-level statistics:
MySQL-compatible mode
Oracle-compatible mode
| View name |
Description |
| oceanbase.DBA_TAB_COL_STATISTICS |
Used to query column-level statistics at the GLOBAL level. |
| oceanbase.DBA_PART_COL_STATISTICS |
Used to query column-level statistics at the PARTITION level. |
| oceanbase.DBA_SUBPART_COL_STATISTICS |
Used to query column-level statistics at the SUBPARTITION level. |
| oceanbase.DBA_TAB_HISTOGRAMS |
Used to query column-level histogram statistics at the GLOBAL level. |
| oceanbase.DBA_PART_HISTOGRAMS |
Used to query column-level histogram statistics at the PARTITION level. |
| oceanbase.DBA_SUBPART_HISTOGRAMS |
Used to query column-level histogram statistics at the SUBPARTITION level. |
| View name |
Description |
|
|
Used to query column-level statistics at the GLOBAL level. |
|
|
Used to query column-level statistics at the PARTITION level. |
- ALL_SUBPART_COL_STATISTICS
- DBA_SUBPART_COL_STATISTICS
- USER_SUBPART_COL_STATISTICS
|
Used to query column-level statistics at the SUBPARTITION level. |
|
|
Used to query column-level histogram statistics at the GLOBAL level. |
|
|
Used to query column-level histogram statistics at the PARTITION level. |
|
|
Used to query column-level histogram statistics at the SUBPARTITION level. |
| sys.ALL_VIRTUAL_COLUMN_STAT_REAL_AGENT |
Used to query basic column-level statistics through a proxy table. |
| sys.ALL_VIRTUAL_HISTOGRAM_STAT_REAL_AGENT |
Used to query histogram information for columns through a proxy table. |
Index statistics
OceanBase Database provides the following views for querying the collection status of index statistics:
MySQL-compatible mode
Oracle-compatible mode
| View name |
Description |
| oceanbase.DBA_IND_STATISTICS |
Used to query index statistics. |
| View name |
Description |
|
|
Used to query index statistics. |
Refresh materialized view statistics
OceanBase Database provides the following views for querying the collection status of materialized view statistics:
MySQL-compatible mode
Oracle-compatible mode
| View name |
Description |
| oceanbase.DBA_MVREF_STATS_PARAMS |
Used to query the refresh statistics attributes associated with each materialized view. |
| oceanbase.DBA_MVREF_STATS |
Used to query the basic timing statistics of materialized view refreshes. |
| oceanbase.DBA_MVREF_CHANGE_STATS |
Used to query statistics related to materialized view refreshes. |
| View name |
Description |
| DBA_MVREF_STATS_PARAMS |
Used to query the refresh statistics attributes associated with each materialized view. |
| DBA_MVREF_STATS |
Used to query the basic timing statistics of materialized view refreshes. |
| DBA_MVREF_CHANGE_STATS |
Used to query statistics related to materialized view refreshes. |
Histograms