The OceanBase Database optimizer supports manual and automatic collection of statistics. It also provides views to help you query the collected statistics.
OceanBase Database provides views compatible with Oracle Database that display the statistics collection status in Oracle mode. The following table describes these views.
| View | Description |
|---|---|
| ALL_TAB_STATISTICS, DBA_TAB_STATISTICS, and USER_TAB_STATISTICS | Displays table-level statistics. |
| ALL_TAB_COL_STATISTICS, DBA_TAB_COL_STATISTICS, and USER_TAB_COL_STATISTICS | Displays global column statistics. |
| ALL_PART_COL_STATISTICS, DBA_PART_COL_STATISTICS, and USER_PART_COL_STATISTICS | Displays partition-level column statistics. |
| ALL_SUBPART_COL_STATISTICS, DBA_SUBPART_COL_STATISTICS, and USER_SUBPART_COL_STATISTICS | Displays subpartition-level column statistics |
| ALL_TAB_HISTOGRAMS, DBA_TAB_HISTOGRAMS, and USER_TAB_HISTOGRAMS | Displays global column histogram statistics. |
| ALL_PART_HISTOGRAMS, DBA_PART_HISTOGRAMS, and USER_PART_HISTOGRAMS | Displays partition-level column histogram statistics. |
| ALL_SUBPART_HISTOGRAMS, DBA_SUBPART_HISTOGRAMS, and USER_SUBPART_HISTOGRAMS | Displays subpartition-level column histogram statistics. |
| ALL_IND_STATISTICS, DBA_IND_STATISTICS, and USER_IND_STATISTICS | Displays index statistics. |
| sys.ALL_VIRTUAL_TABLE_STAT_REAL_AGENT | The agent table that displays table-level statistics. |
| sys.ALL_VIRTUAL_COLUMN_STAT_REAL_AGENT | The agent table that displays column-level basic statistics. |
| sys.ALL_VIRTUAL_HISTOGRAM_STAT_REAL_AGENT | The agent table that displays column-level histogram information. |
The following table describes the views that display statistics in the MySQL mode of OceanBase Database.
| View | Description |
|---|---|
| oceanbase.DBA_TAB_STATISTICS | Displays table-level statistics. |
| oceanbase.DBA_TAB_COL_STATISTICS | Displays global column statistics. |
| oceanbase.DBA_PART_COL_STATISTICS | Displays partition-level column statistics. |
| oceanbase.DBA_SUBPART_COL_STATISTICS | Displays subpartition-level column statistics |
| oceanbase.DBA_TAB_HISTOGRAMS | Displays global column histogram statistics. |
| oceanbase.DBA_PART_HISTOGRAMS | Displays partition-level column histogram statistics. |
| oceanbase.DBA_SUBPART_HISTOGRAMS | Displays subpartition-level column histogram statistics. |
| oceanbase.DBA_IND_STATISTICS | Displays index statistics. |