The OceanBase Database optimizer supports the following statistics collection methods. It also provides views for querying collected statistics.
Manual statistics collection: You can collect statistics by using the
DBMS_STATSsystem package or anANALYZEstatement. For more information, see Manual statistics collection.Automatic statistics collection: The system periodically collects missing or stale statistics through maintenance windows. For more information, see Automatic statistics collection.
Online statistics collection: The system collects statistics during a bulk data load. For more information, see Online statistics collection.
Asynchronous statistics collection: The system periodically checks data changes in tables or partitions to promptly process tables or partitions whose data has changed significantly. For more information, see Asynchronous statistics collection.
Table-level statistics
OceanBase Database provides views for querying the collection status of table-level statistics:
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:
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. |
|
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:
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:
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. |