Note
This view is introduced since OceanBase Database V3.2.1.
Purpose
This view displays the histograms of the subpartitions of the partitions owned by the current user.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table where the histogram belongs. |
| SUBPARTITION_NAME | VARCHAR2(128) | NO | The name of the subpartition where the histogram belongs. |
| COLUMN_NAME | VARCHAR2(128) | NO | The name of the column where the histogram belongs. |
| ENDPOINT_NUMBER | NUMBER | NO | The number of bucket accumulations. |
| ENDPOINT_VALUE | NUMBER | NO | The normalized endpoint value of the bucket. |
| ENDPOINT_ACTUAL_VALUE | VARCHAR2(4000) | NO | The endpoint value of the bucket. |
| ENDPOINT_ACTUAL_VALUE_RAW | VARCHAR2(4000) | NO | The binary endpoint value of the bucket. |
| ENDPOINT_REPEAT_COUNT | NUMBER | NO | The number of times that the endpoint value of the bucket appears. |
Sample query
Query the histogram information of the subpartitions of the T_SUBPART table in the partitioned tables owned by the current user.
obclient [SYS]> SELECT * FROM SYS.USER_SUBPART_HISTOGRAMS WHERE TABLE_NAME ='T_SUBPART';
The query result is as follows:
+------------+-------------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
| TABLE_NAME | SUBPARTITION_NAME | COLUMN_NAME | ENDPOINT_NUMBER | ENDPOINT_VALUE | ENDPOINT_ACTUAL_VALUE | ENDPOINT_ACTUAL_VALUE_RAW | ENDPOINT_REPEAT_COUNT |
+------------+-------------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
| T_SUBPART | P1SP0 | ID | 50 | NULL | 2 | 2 | 50 |
| T_SUBPART | P1SP0 | ID | 100 | NULL | 7 | 7 | 50 |
| T_SUBPART | P1SP0 | ID | 150 | NULL | 999 | 999 | 50 |
| T_SUBPART | P1SP0 | QUANTITY | 145 | NULL | 1 | 1 | 145 |
| T_SUBPART | P1SP0 | QUANTITY | 150 | NULL | 1000 | 1000 | 5 |
| T_SUBPART | P1SP1 | ID | 50 | NULL | 1 | 1 | 50 |
| T_SUBPART | P1SP1 | ID | 100 | NULL | 4 | 4 | 50 |
| T_SUBPART | P1SP1 | ID | 150 | NULL | 8 | 8 | 50 |
| T_SUBPART | P1SP1 | QUANTITY | 150 | NULL | 1 | 1 | 150 |
| T_SUBPART | P1SP2 | ID | 50 | NULL | 3 | 3 | 50 |
| T_SUBPART | P1SP2 | ID | 100 | NULL | 5 | 5 | 50 |
| T_SUBPART | P1SP2 | QUANTITY | 100 | NULL | 1 | 1 | 100 |
| T_SUBPART | P1SP3 | ID | 50 | NULL | 6 | 6 | 50 |
| T_SUBPART | P1SP3 | ID | 100 | NULL | 9 | 9 | 50 |
| T_SUBPART | P1SP3 | QUANTITY | 100 | NULL | 1 | 1 | 100 |
| T_SUBPART | P2SP0 | ID | 30 | NULL | 2 | 2 | 30 |
| T_SUBPART | P2SP0 | ID | 60 | NULL | 7 | 7 | 30 |
| T_SUBPART | P2SP0 | ID | 90 | NULL | 999 | 999 | 30 |
| T_SUBPART | P2SP0 | QUANTITY | 87 | NULL | 1 | 1 | 87 |
| T_SUBPART | P2SP0 | QUANTITY | 90 | NULL | 1000 | 1000 | 3 |
| T_SUBPART | P2SP1 | ID | 30 | NULL | 1 | 1 | 30 |
| T_SUBPART | P2SP1 | ID | 60 | NULL | 4 | 4 | 30 |
| T_SUBPART | P2SP1 | ID | 90 | NULL | 8 | 8 | 30 |
| T_SUBPART | P2SP1 | QUANTITY | 90 | NULL | 1 | 1 | 90 |
| T_SUBPART | P2SP2 | ID | 30 | NULL | 3 | 3 | 30 |
| T_SUBPART | P2SP2 | ID | 60 | NULL | 5 | 5 | 30 |
| T_SUBPART | P2SP2 | QUANTITY | 60 | NULL | 1 | 1 | 60 |
| T_SUBPART | P2SP3 | ID | 30 | NULL | 6 | 6 | 30 |
| T_SUBPART | P2SP3 | ID | 60 | NULL | 9 | 9 | 30 |
| T_SUBPART | P2SP3 | QUANTITY | 60 | NULL | 1 | 1 | 60 |
| T_SUBPART | P3SP0 | ID | 20 | NULL | 2 | 2 | 20 |
| T_SUBPART | P3SP0 | ID | 40 | NULL | 7 | 7 | 20 |
| T_SUBPART | P3SP0 | ID | 60 | NULL | 999 | 999 | 20 |
| T_SUBPART | P3SP0 | QUANTITY | 58 | NULL | 1 | 1 | 58 |
| T_SUBPART | P3SP0 | QUANTITY | 60 | NULL | 1000 | 1000 | 2 |
| T_SUBPART | P3SP1 | ID | 20 | NULL | 1 | 1 | 20 |
| T_SUBPART | P3SP1 | ID | 40 | NULL | 4 | 4 | 20 |
| T_SUBPART | P3SP1 | ID | 60 | NULL | 8 | 8 | 20 |
| T_SUBPART | P3SP1 | QUANTITY | 60 | NULL | 1 | 1 | 60 |
| T_SUBPART | P3SP2 | ID | 20 | NULL | 3 | 3 | 20 |
| T_SUBPART | P3SP2 | ID | 40 | NULL | 5 | 5 | 20 |
| T_SUBPART | P3SP2 | QUANTITY | 40 | NULL | 1 | 1 | 40 |
| T_SUBPART | P3SP3 | ID | 20 | NULL | 6 | 6 | 20 |
| T_SUBPART | P3SP3 | ID | 40 | NULL | 9 | 9 | 20 |
| T_SUBPART | P3SP3 | QUANTITY | 40 | NULL | 1 | 1 | 40 |
+------------+-------------------+-------------+-----------------+----------------+-----------------------+---------------------------+-----------------------+
45 rows in set
References
To view the histogram information of the subpartitions of the partitioned tables that are accessible to the current user, see ALL_SUBPART_HISTOGRAMS.
To view the histogram information of the subpartitions of all partitioned tables in the current tenant, see DBA_SUBPART_HISTOGRAMS.
To view the histogram statistics of tables, query the following views:
To view the histogram statistics of partitions, query the following views:
To view the column statistics of tables, query the following views:
To view the global column statistics, query the following views:
To view the column statistics of partitions, query the following views:
To view the column statistics of subpartitions, query the following views:
To view the index statistics, query the following views:
For more information about how to collect statistics, see the following topics: