Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The oceanbase.DBA_PART_HISTOGRAMS view displays the histograms of all partitioned tables of 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. |
| PARTITION_NAME | varchar(128) | NO | The name of the partitioned table. |
| COLUMN_NAME | varchar(128) | NO | The name of the column. |
| ENDPOINT_NUMBER | decimal(10,0) | NO | The bucket number of the histogram. |
| ENDPOINT_VALUE | decimal(10,0) | NO | The standardized endpoint value for the bucket. |
| ENDPOINT_ACTUAL_VALUE | text | NO | The actual (non-standardized) string of the endpoint value for the bucket. |
| ENDPOINT_ACTUAL_VALUE_RAW | text | NO | The actual value of the endpoint in the original format. |
| ENDPOINT_REPEAT_COUNT | decimal(10,0) | NO | The endpoint frequency (only for hybrid histograms). The value is 0 for other types of histograms. |
Sample query
Query the histogram information of the first-level partitions of the partitioned table test_part_hist in the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_PART_HISTOGRAMS WHERE TABLE_NAME ='test_part_hist';
The query result is as follows:
+----------+----------------+----------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
| OWNER | TABLE_NAME | PARTITION_NAME | COLUMN_NAME | ENDPOINT_NUMBER | ENDPOINT_VALUE | ENDPOINT_ACTUAL_VALUE | ENDPOINT_ACTUAL_VALUE_RAW | ENDPOINT_REPEAT_COUNT |
+----------+----------------+----------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
| infotest | test_part_hist | p0 | value | 250 | NULL | 100 | 04053F0064 | 50 |
| infotest | test_part_hist | p0 | value | 200 | NULL | 8 | 04053F0008 | 50 |
| infotest | test_part_hist | p0 | value | 150 | NULL | 6 | 04053F0006 | 50 |
| infotest | test_part_hist | p0 | value | 100 | NULL | 4 | 04053F0004 | 50 |
| infotest | test_part_hist | p0 | value | 50 | NULL | 2 | 04053F0002 | 50 |
| infotest | test_part_hist | p0 | category | 250 | NULL | 'B' | 16022DFF014200 | 200 |
| infotest | test_part_hist | p0 | category | 50 | NULL | 'A' | 16022DFF014100 | 50 |
| infotest | test_part_hist | p1 | value | 250 | NULL | 9 | 04053F0009 | 50 |
| infotest | test_part_hist | p1 | value | 200 | NULL | 7 | 04053F0007 | 50 |
| infotest | test_part_hist | p1 | value | 150 | NULL | 5 | 04053F0005 | 50 |
| infotest | test_part_hist | p1 | value | 100 | NULL | 3 | 04053F0003 | 50 |
| infotest | test_part_hist | p1 | value | 50 | NULL | 1 | 04053F0001 | 50 |
| infotest | test_part_hist | p1 | category | 250 | NULL | 'B' | 16022DFF014200 | 250 |
| infotest | test_part_hist | p2 | value | 250 | NULL | 100 | 04053F0064 | 50 |
| infotest | test_part_hist | p2 | value | 200 | NULL | 8 | 04053F0008 | 50 |
| infotest | test_part_hist | p2 | value | 150 | NULL | 6 | 04053F0006 | 50 |
| infotest | test_part_hist | p2 | value | 100 | NULL | 4 | 04053F0004 | 50 |
| infotest | test_part_hist | p2 | value | 50 | NULL | 2 | 04053F0002 | 50 |
| infotest | test_part_hist | p2 | category | 250 | NULL | 'B' | 16022DFF014200 | 200 |
| infotest | test_part_hist | p2 | category | 50 | NULL | 'A' | 16022DFF014100 | 50 |
| infotest | test_part_hist | p3 | value | 250 | NULL | 9 | 04053F0009 | 50 |
| infotest | test_part_hist | p3 | value | 200 | NULL | 7 | 04053F0007 | 50 |
| infotest | test_part_hist | p3 | value | 150 | NULL | 5 | 04053F0005 | 50 |
| infotest | test_part_hist | p3 | value | 100 | NULL | 3 | 04053F0003 | 50 |
| infotest | test_part_hist | p3 | value | 50 | NULL | 1 | 04053F0001 | 50 |
| infotest | test_part_hist | p3 | category | 250 | NULL | 'B' | 16022DFF014200 | 250 |
+----------+----------------+----------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
26 rows in set
References
View histogram statistics at the table level: DBA_TAB_HISTOGRAMS
View histogram statistics at the subpartition level: DBA_SUBPART_HISTOGRAMS
View column statistics at the table level: DBA_TAB_STATISTICS
View column statistics at the global level: DBA_TAB_COL_STATISTICS
View column statistics at the partition level: DBA_PART_COL_STATISTICS
View column statistics at the subpartition level: DBA_SUBPART_COL_STATISTICS
View index statistics: DBA_IND_STATISTICS
For more information about how to collect statistics, see the following topics: