Overview
Displays histograms for all columns in the current tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | User to Which the Histogram Belongs |
| TABLE_NAME | varchar(128) | NO | Table Name of the Histogram |
| COLUMN_NAME | varchar(128) | NO | Column Name of the Histogram |
| ENDPOINT_NUMBER | decimal(10,0) | NO | Cumulative Frequency of Buckets |
| ENDPOINT_VALUE | decimal(10,0) | NO | Normalized Bucket Endpoint Value |
| ENDPOINT_ACTUAL_VALUE | text | NO | Bucket Endpoint Value |
| ENDPOINT_ACTUAL_VALUE_RAW | text | NO | Binary value of the bucket endpoint |
| ENDPOINT_REPEAT_COUNT | decimal(10,0) | NO | Frequency of Bucket Endpoint Values |
| SCOPE | varchar(7) | NO | Range of the histogram |
Sample query
Query the table-level histogram information of the t_subpart table in 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 histogram statistics at the partition level: DBA_PART_HISTOGRAMS
View subpartition-level histogram statistics: 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: