Note
This view is available starting with V4.0.0.
Purpose
This view displays the histograms of all columns in the current tenant.
Columns
Column |
Type |
Nullable |
Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | The owner of the table. |
| TABLE_NAME | varchar(128) | NO | The name of the table. |
| COLUMN_NAME | varchar(128) | NO | The name of the column or attribute of the object type. |
| ENDPOINT_NUMBER | decimal(10,0) | NO | The number of histogram buckets. |
| ENDPOINT_VALUE | decimal(10,0) | NO | The standardized endpoint value of the bucket. |
| ENDPOINT_ACTUAL_VALUE | text | NO | The actual string value of the bucket endpoint (non-standardized). |
| ENDPOINT_ACTUAL_VALUE_RAW | text | NO | The endpoint value in the original format. |
| ENDPOINT_REPEAT_COUNT | decimal(10,0) | NO | The endpoint frequency. For mixed histograms, this value is the frequency of the endpoint. For other histogram types, this value is 0. |
| SCOPE | varchar(7) | NO | The value used to indicate the statistics collected on tables other than global temporary tables. For global temporary tables, the value can be:
|
Sample query
In the sys tenant, 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
Query the histogram statistics at the partition level: DBA_PART_HISTOGRAMS
Query the histogram statistics at the subpartition level: DBA_SUBPART_HISTOGRAMS
Query the column statistics at the table level: DBA_TAB_STATISTICS
Query the global column statistics: DBA_TAB_COL_STATISTICS
Query the column statistics at the partition level: DBA_PART_COL_STATISTICS
Query the column statistics at the subpartition level: DBA_SUBPART_COL_STATISTICS
Query the index statistics: DBA_IND_STATISTICS
For information about how to collect statistics, see the following topics:
