Skip to main content

PURGE_REFRESH_STATS

PURGE_REFRESH_STATS is used to forcibly delete the refresh statistics of materialized views that exceed the specified retention period.

Syntax

PROCEDURE purge_refresh_stats(
IN mv_name VARCHAR(65535),
IN retention_period INT);

Parameters

ParameterDescription
mv_nameThe name of the materialized view.
  • When the value is NULL, the operation is performed on all materialized views.
retention_periodThe number of days for which statistics are retained, ranging from 1 to 365,000. Statistics records exceeding this period are automatically deleted. The default is 31 days.
  • If the value is NULL, the default cleanup strategy of the automatic statistics cleanup mechanism is used.
  • If the value is set to -1, all related statistics records are deleted.