Note
This view is introduced since OceanBase Database V3.2.1.
Purpose
This view displays the table-level histograms of all tables in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The owner of the histogram. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table where the histogram belongs. |
| COLUMN_NAME | VARCHAR2(128) | NO | The name of the column where the histogram belongs. |
| ENDPOINT_NUMBER | NUMBER | NO | The number of bucket accumulations. |
| ENDPOINT_VALUE | NUMBER | NO | The normalized endpoint value of the bucket. |
| ENDPOINT_ACTUAL_VALUE | VARCHAR2(4000) | NO | The endpoint value of the bucket. |
| ENDPOINT_ACTUAL_VALUE_RAW | VARCHAR2(4000) | NO | The binary endpoint value of the bucket. |
| ENDPOINT_REPEAT_COUNT | NUMBER | NO | The number of times that the endpoint value of the bucket appears. |
| SCOPE | VARCHAR2(7) | NO | The scope of the histogram. |
Sample query
Query the table-level histogram information of the T_SUBPART table in the current tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_TAB_HISTOGRAMS WHERE TABLE_NAME='T_SUBPART';
The query result is as follows:
+-------+------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+-------+
| OWNER | TABLE_NAME | COLUMN_NAME | ENDPOINT_NUMBER | ENDPOINT_VALUE | ENDPOINT_ACTUAL_VALUE | ENDPOINT_ACTUAL_VALUE_RAW | ENDPOINT_REPEAT_COUNT | SCOPE |
+-------+------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+-------+
| SYS | T_SUBPART | C1 | 1 | NULL | 0 | 0F053F0080000000 | 1 | NULL |
| SYS | T_SUBPART | C1 | 2501 | NULL | 2500 | 0F053F00C0000001C4090000 | 1 | NULL |
| SYS | T_SUBPART | C1 | 5001 | NULL | 5000 | 0F053F00C000000188130000 | 1 | NULL |
| SYS | T_SUBPART | C1 | 7501 | NULL | 7500 | 0F053F00C00000014C1D0000 | 1 | NULL |
| SYS | T_SUBPART | C1 | 10000 | NULL | 9999 | 0F053F00C00000010F270000 | 1 | NULL |
| SYS | T_SUBPART | C2 | 10 | NULL | 0 | 0F053F0080000000 | 10 | NULL |
| SYS | T_SUBPART | C2 | 2510 | NULL | 250 | 0F053F00C0000001FA000000 | 10 | NULL |
| SYS | T_SUBPART | C2 | 5010 | NULL | 500 | 0F053F00C0000001F4010000 | 10 | NULL |
| SYS | T_SUBPART | C2 | 7510 | NULL | 750 | 0F053F00C0000001EE020000 | 10 | NULL |
| SYS | T_SUBPART | C2 | 10000 | NULL | 999 | 0F053F00C0000001E7030000 | 10 | NULL |
| SYS | T_SUBPART | C3 | 5 | NULL | 0 | 0F053F0080000000 | 5 | NULL |
| SYS | T_SUBPART | C3 | 2505 | NULL | 500 | 0F053F00C0000001F4010000 | 5 | NULL |
| SYS | T_SUBPART | C3 | 5005 | NULL | 1000 | 0F053F00C0000001E8030000 | 5 | NULL |
| SYS | T_SUBPART | C3 | 7505 | NULL | 1500 | 0F053F00C0000001DC050000 | 5 | NULL |
| SYS | T_SUBPART | C3 | 10000 | NULL | 1999 | 0F053F00C0000001CF070000 | 5 | NULL |
+-------+------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+-------+
15 rows in set
References
ALL_TAB_HISTOGRAMS: view the table-level histogram statistics of all tables that the current user can access.
USER_TAB_HISTOGRAMS: view the table-level histogram statistics of all tables owned by the current user.
Query the following views for partition-level histogram statistics:
Query the following views for subpartition-level histogram statistics:
Query the following views for table-level column statistics:
Query the following views for global column statistics:
Query the following views for partition-level column statistics:
Query the following views for subpartition-level column statistics:
Query the following views for index statistics:
For more information about how to collect statistics, see the following topics: