Skip to main content
Version: 3.2

SHOW ANALYZE JOB

Description

Views the information and status of custom collection tasks.

By default, StarRocks automatically collects full statistics of a table. It checks for any data updates every 5 minutes. If data change is detected, data collection will be automatically triggered. If you do not want to use automatic full collection, you can set the FE configuration item enable_collect_full_statistic to false and customize a collection task.

This statement is supported from v2.4.

Syntax

SHOW ANALYZE JOB [WHERE]

You can filter results by using the WHERE clause. The statement returns the following columns.

ColumnDescription
IdThe ID of the collection task.
DatabaseThe database name.
TableThe table name.
ColumnsThe column names.
TypeThe type of statistics, including FULL and SAMPLE.
ScheduleThe type of scheduling. The type is SCHEDULE for an automatic task.
PropertiesCustom parameters.
StatusThe task status, including PENDING, RUNNING, SUCCESS, and FAILED.
LastWorkTimeThe time of the last collection.
ReasonThe reason why the task failed. NULL is returned if task execution was successful.

Examples

-- View all the custom collection tasks.
SHOW ANALYZE JOB

-- View custom collection tasks of database `test`.
SHOW ANALYZE JOB where `database` = 'test';

References

CREATE ANALYZE: customize an automatic collection task.

DROP ANALYZE: delete a custom collection task.

KILL ANALYZE: cancel a custom collection task that is running.

For more information about collecting statistics for CBO, see Gather statistics for CBO.