Note
This view is available starting with V4.2.0.
Purpose
This view displays the execution status of historical statistics collection for tables in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | The username of the table. |
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| TASK_ID | varchar(36) | NO | The task ID to which the table statistics collection belongs. |
| STATUS | varchar(8) | NO | The status of the statistics collection task. Valid values: SUCCESS and FAILED. |
| START_TIME | datetime(6) | YES | The start time of the table statistics collection. |
| END_TIME | datetime(6) | YES | The end time of the table statistics collection. |
| MEMORY_USED | bigint(20) | YES | The memory used by the table statistics collection. |
| STAT_REFRESH_FAILED_LIST | text | YES | The list of failed statistics cache refreshes. |
| PROPERTIES | text | YES | The properties set for the table statistics collection. |
Sample query
Query the execution status of historical statistics collection for the tbl1 table in the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_TABLE_OPT_STAT_GATHER_HISTORY WHERE TABLE_NAME='tbl1'\G
The query result is as follows:
*************************** 1. row ***************************
OWNER: infotest
TABLE_NAME: tbl1
TASK_ID: 0fa598be-ff27-11ef-8530-4e5e0075b0a3
STATUS: SUCCESS
START_TIME: 2025-03-12 17:47:50.307858
END_TIME: 2025-03-12 17:47:50.368191
MEMORY_USED: 5370
STAT_REFRESH_FAILED_LIST: NULL
PROPERTIES: GRANULARITY:GLOBAL;METHOD_OPT:FOR ALL COLUMNS SIZE AUTO;DEGREE:1;ESTIMATE_PERCENT:100.000000;BLOCK_SAMPLE:0;STALE_PERCENT:-1.000000;HIST_EST_PERCENT:100.000000
*************************** 2. row ***************************
OWNER: infotest
TABLE_NAME: tbl1
TASK_ID: ace0550b-007d-11f0-8530-4e5e0075b0a3
STATUS: SUCCESS
START_TIME: 2025-03-14 10:40:22.031993
END_TIME: 2025-03-14 10:40:22.069288
MEMORY_USED: 5152
STAT_REFRESH_FAILED_LIST: NULL
PROPERTIES: GRANULARITY:AUTO;METHOD_OPT:FOR ALL COLUMNS SIZE AUTO;DEGREE:1;ESTIMATE_PERCENT:100.000000;BLOCK_SAMPLE:0;STALE_PERCENT:-1.000000;HIST_EST_PERCENT:100.000000
2 rows in set
References
To view the status of historical statistics collection at the tenant level, see DBA_OB_TASK_OPT_STAT_GATHER_HISTORY.
For information about how to collect statistics, see the following topics:
For more information about statistics collection monitoring and diagnostics, see Monitor and diagnose statistics collection.