Monitor and maintain your PostgreSQL database for self-hosted Prefect deployments
events
- Automatically generated for all state changes (often the largest table)log
- Flow and task run logsflow_run
and task_run
- Execution recordsflow_run_state
and task_run_state
- State historystart_time
(when the flow run began execution), not created
time (when the flow run was created in the database). This means flows that were created but never started won’t be deleted.
SELECT
instead of DELETE
to preview what will be removed
pg_repack
instead of VACUUM FULL
prefect config view | grep EVENTS_RETENTION
ANALYZE;
pg_stat_user_tables
EXPLAIN ANALYZE