Note
This view is available starting with V4.0.0.
Overview
Displays histograms for all columns in the current tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | Owner of the table |
| TABLE_NAME | varchar(128) | NO | Table name |
| COLUMN_NAME | varchar(128) | NO | Column name or attribute of the object type column |
| ENDPOINT_NUMBER | decimal(10,0) | NO | Number of Histogram Buckets |
| ENDPOINT_VALUE | decimal(10,0) | NO | Standardized Endpoint Value of This Bucket |
| ENDPOINT_ACTUAL_VALUE | text | NO | The actual string value of this bucket endpoint (non-standardized). |
| ENDPOINT_ACTUAL_VALUE_RAW | text | NO | Actual value of the endpoint in the original format |
| ENDPOINT_REPEAT_COUNT | decimal(10,0) | NO | Endpoint Frequency (Only for hybrid histograms; set to 0 for other histogram types.) |
| SCOPE | varchar(7) | NO | This value is used for statistics collected on any table except global temporary tables. For global temporary tables, the possible values are:
|
Sample query
In the sys tenant, view the table-level histogram information for the t_subpart table of the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.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 |
+-------+------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+-------+
| test | t_subpart | c1 | 1 | NULL | 0 | 04053F0000 | 1 | NULL |
| test | t_subpart | c1 | 2501 | NULL | 2500 | 04053F00C413 | 1 | NULL |
| test | t_subpart | c1 | 5001 | NULL | 5000 | 04053F008827 | 1 | NULL |
| test | t_subpart | c1 | 7501 | NULL | 7500 | 04053F00CC3A | 1 | NULL |
| test | t_subpart | c1 | 10000 | NULL | 9999 | 04053F008F4E | 1 | NULL |
| test | t_subpart | c2 | 10 | NULL | 0 | 04053F0000 | 10 | NULL |
| test | t_subpart | c2 | 2510 | NULL | 250 | 04053F00FA01 | 10 | NULL |
| test | t_subpart | c2 | 5010 | NULL | 500 | 04053F00F403 | 10 | NULL |
| test | t_subpart | c2 | 7510 | NULL | 750 | 04053F00EE05 | 10 | NULL |
| test | t_subpart | c2 | 10000 | NULL | 999 | 04053F00E707 | 10 | NULL |
| test | t_subpart | c3 | 5 | NULL | 0 | 04053F0000 | 5 | NULL |
| test | t_subpart | c3 | 2505 | NULL | 500 | 04053F00F403 | 5 | NULL |
| test | t_subpart | c3 | 5005 | NULL | 1000 | 04053F00E807 | 5 | NULL |
| test | t_subpart | c3 | 7505 | NULL | 1500 | 04053F00DC0B | 5 | NULL |
| test | t_subpart | c3 | 10000 | NULL | 1999 | 04053F00CF0F | 5 | NULL |
+-------+------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+-------+
15 rows in set
References
View partition-level histogram statistics: DBA_PART_HISTOGRAMS
View histogram statistics at the subpartition level: DBA_SUBPART_HISTOGRAMS
View table-level column statistics: DBA_TAB_STATISTICS
View global column statistics: DBA_TAB_COL_STATISTICS
View partition-level column statistics: DBA_PART_COL_STATISTICS
View column statistics at the subpartition level: DBA_SUBPART_COL_STATISTICS
View index statistics: DBA_IND_STATISTICS
For information about how to collect statistics, see the following topics:
