Martin Durkac
10/18/2021, 7:25 AMAnurag Bajpai
10/18/2021, 8:07 AMdocker exec -it tmp_postgres_1 sh -c "psql -U prefect -d prefect_server -c \"DELETE FROM task_run WHERE updated < NOW() - INTERVAL '30 days';\" "
docker exec -it tmp_postgres_1 sh -c "psql -U prefect -d prefect_server -c \"DELETE FROM log WHERE updated < NOW() - INTERVAL '30 days';\" "
docker exec -it tmp_postgres_1 sh -c "psql -U prefect -d prefect_server -c \"DELETE FROM task_run_state WHERE updated < NOW() - INTERVAL '30 days';\" "
You might want to look into which tables are taking up the most space and modify the table names and WHERE clauses accordingly.
Since your tables have already expanded in size, you'll also want to run a VACUUM FULL after these.Martin Durkac
10/18/2021, 8:33 AMAnna Geller
Martin Durkac
10/18/2021, 8:46 AMAnna Geller
Kevin Kho
Results
. A lot of people find that Results
generated by Prefect end up taking a lot of space. You can delete some of the task results in the .prefect
folder as these can take up a bit of memory.Martin Durkac
10/19/2021, 7:58 AMKevin Kho