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 of the statistics collection. |
| 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 statistics collection. |
| END_TIME | datetime(6) | YES | The end time of the statistics collection. |
| MEMORY_USED | bigint(20) | YES | The memory used for the statistics collection. |
| STAT_REFRESH_FAILED_LIST | text | YES | The list of failed statistics cache refreshes. |
| PROPERTIES | text | YES | The property settings for the 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: test
TABLE_NAME: tbl1
TASK_ID: 1313c707-ff26-11ef-8530-4e5e0075b0a3
STATUS: SUCCESS
START_TIME: 2025-03-12 17:40:46.566433
END_TIME: 2025-03-12 17:40:46.630407
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
1 row in set
References
Query the status of historical statistics collection at the tenant level: DBA_OB_TASK_OPT_STAT_GATHER_HISTORY
For more 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.