Note
This view is available starting with V3.2.1.
Purpose
This view displays the histogram information at the table level for all tables accessible to the current user.
Applicability
This view is available only in Oracle mode of OceanBase Database.
Columns
Column |
Type |
Nullable |
Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The user to which the histogram belongs. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table to which the histogram belongs. |
| COLUMN_NAME | VARCHAR2(128) | NO | The name of the column to which the histogram belongs. |
| ENDPOINT_NUMBER | NUMBER | NO | The number of buckets. |
| ENDPOINT_VALUE | NUMBER | NO | The normalized value of the bucket endpoint. |
| ENDPOINT_ACTUAL_VALUE | VARCHAR2(4000) | NO | The value of the bucket endpoint. |
| ENDPOINT_ACTUAL_VALUE_RAW | VARCHAR2(4000) | NO | The binary value of the bucket endpoint. |
| ENDPOINT_REPEAT_COUNT | NUMBER | NO | The frequency of the bucket endpoint value. |
| SCOPE | VARCHAR2(7) | YES | The scope to which the histogram belongs. |
Sample query
Query the table-level histogram information of the T_SUBPART table accessible to the current user.
obclient [SYS]> SELECT * FROM SYS.ALL_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
To view the table-level histogram statistics of all tables in the current tenant, see DBA_TAB_HISTOGRAMS.
To view the table-level histogram statistics of all tables owned by the current user, see USER_TAB_HISTOGRAMS.
To view the column-level histogram statistics at the partition level, query the following views:
To view the column-level histogram statistics at the subpartition level, query the following views:
To view the table-level column statistics, query the following views:
To view the global column statistics, query the following views:
To view the column statistics at the partition level, query the following views:
To view the column statistics at the subpartition level, query the following views:
To view the index statistics, query the following views:
For information about how to collect statistics, see the following topics:
