Bharat Khaneja
02/06/2025, 1:51 AMMarvin
02/06/2025, 1:51 AMevent_resources
) has been identified as one that accumulates data indefinitely and can be safely cleaned alongside corresponding events. It seems to be a common source of database growth issues (GitHub Issue).
2. Consideration for Foreign Keys: Be cautious with foreign key constraints when deleting data. Ensure that deleting logs does not affect other tables that might reference those logs (GitHub Discussion).
3. Retention Policies: While Prefect Cloud manages retention automatically, for self-hosted setups, you can use tools like pg_cron
to schedule periodic cleanup tasks. This can help maintain database performance by purging old logs without affecting critical data.
For a more tailored approach, you might want to inspect your database schema to identify log-related tables specific to your setup. This might include tables like flow_run_logs
or similar, depending on how your Prefect instance is configured.
For further reading on managing audit logs in Prefect Cloud, you can refer to the Prefect documentation.
If you need a more specific solution or further assistance, examining your database schema directly or consulting Prefect's community resources might be beneficial.