Note
This view is available starting with V4.0.0.
Purpose
This view displays the histogram data of subpartitions for all partitioned tables in the current tenant (the endpoints of each histogram).
Columns
Column |
Type |
Nullable |
Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | The owner of the table. |
| TABLE_NAME | varchar(128) | NO | The name of the table. |
| SUBPARTITION_NAME | varchar(128) | NO | The name of the subpartition 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 normalized endpoint value of the bucket. |
| ENDPOINT_ACTUAL_VALUE | text | NO | The actual string value of the bucket endpoint (non-normalized). |
| ENDPOINT_ACTUAL_VALUE_RAW | text | NO | The endpoint value in the original format. |
| ENDPOINT_REPEAT_COUNT | decimal(10,0) | NO | The endpoint frequency (0 for histograms other than hybrid histograms). |
Sample query
Query the histogram information of subpartitions in the partitioned table sales_subpart in the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_SUBPART_HISTOGRAMS WHERE TABLE_NAME ='sales_subpart';
The query result is as follows:
+----------+---------------+-------------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
| OWNER | TABLE_NAME | SUBPARTITION_NAME | COLUMN_NAME | ENDPOINT_NUMBER | ENDPOINT_VALUE | ENDPOINT_ACTUAL_VALUE | ENDPOINT_ACTUAL_VALUE_RAW | ENDPOINT_REPEAT_COUNT |
+----------+---------------+-------------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
| infotest | sales_subpart | p2023sp0 | quantity | 127 | NULL | 1 | 04053F0001 | 127 |
| infotest | sales_subpart | p2023sp0 | product_id | 127 | NULL | 8 | 04053F0008 | 63 |
| infotest | sales_subpart | p2023sp0 | product_id | 64 | NULL | 4 | 04053F0004 | 64 |
| infotest | sales_subpart | p2023sp1 | quantity | 190 | NULL | 1 | 04053F0001 | 190 |
| infotest | sales_subpart | p2023sp1 | product_id | 190 | NULL | 9 | 04053F0009 | 63 |
| infotest | sales_subpart | p2023sp1 | product_id | 127 | NULL | 5 | 04053F0005 | 63 |
| infotest | sales_subpart | p2023sp1 | product_id | 64 | NULL | 1 | 04053F0001 | 64 |
| infotest | sales_subpart | p2023sp2 | quantity | 127 | NULL | 1 | 04053F0001 | 127 |
| infotest | sales_subpart | p2023sp2 | product_id | 127 | NULL | 6 | 04053F0006 | 63 |
| infotest | sales_subpart | p2023sp2 | product_id | 64 | NULL | 2 | 04053F0002 | 64 |
| infotest | sales_subpart | p2023sp3 | quantity | 191 | NULL | 1000 | 04053F00E807 | 6 |
| infotest | sales_subpart | p2023sp3 | quantity | 185 | NULL | 1 | 04053F0001 | 185 |
| infotest | sales_subpart | p2023sp3 | product_id | 191 | NULL | 999 | 04053F00E707 | 64 |
| infotest | sales_subpart | p2023sp3 | product_id | 127 | NULL | 7 | 04053F0007 | 63 |
| infotest | sales_subpart | p2023sp3 | product_id | 64 | NULL | 3 | 04053F0003 | 64 |
| infotest | sales_subpart | p2024sp0 | quantity | 73 | NULL | 1 | 04053F0001 | 73 |
| infotest | sales_subpart | p2024sp0 | product_id | 73 | NULL | 8 | 04053F0008 | 37 |
| infotest | sales_subpart | p2024sp0 | product_id | 36 | NULL | 4 | 04053F0004 | 36 |
| infotest | sales_subpart | p2024sp1 | quantity | 110 | NULL | 1 | 04053F0001 | 110 |
| infotest | sales_subpart | p2024sp1 | product_id | 110 | NULL | 9 | 04053F0009 | 37 |
| infotest | sales_subpart | p2024sp1 | product_id | 73 | NULL | 5 | 04053F0005 | 37 |
| infotest | sales_subpart | p2024sp1 | product_id | 36 | NULL | 1 | 04053F0001 | 36 |
| infotest | sales_subpart | p2024sp2 | quantity | 73 | NULL | 1 | 04053F0001 | 73 |
| infotest | sales_subpart | p2024sp2 | product_id | 73 | NULL | 6 | 04053F0006 | 37 |
| infotest | sales_subpart | p2024sp2 | product_id | 36 | NULL | 2 | 04053F0002 | 36 |
| infotest | sales_subpart | p2024sp3 | quantity | 109 | NULL | 1000 | 04053F00E807 | 4 |
| infotest | sales_subpart | p2024sp3 | quantity | 105 | NULL | 1 | 04053F0001 | 105 |
| infotest | sales_subpart | p2024sp3 | product_id | 109 | NULL | 999 | 04053F00E707 | 36 |
| infotest | sales_subpart | p2024sp3 | product_id | 73 | NULL | 7 | 04053F0007 | 37 |
| infotest | sales_subpart | p2024sp3 | product_id | 36 | NULL | 3 | 04053F0003 | 36 |
+----------+---------------+-------------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
30 rows in set
References
Query the histogram statistics at the table level: DBA_TAB_HISTOGRAMS
Query the histogram statistics at the partition level: DBA_PART_HISTOGRAMS
Query the column statistics at the table level: DBA_TAB_STATISTICS
Query the column statistics at the global level: 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:
