#How to clean up old runs from database?

1 messages · Page 1 of 1 (latest)

odd ingot
#

I'm working on a project that makes a lot of runs, and I'm hosting Trigger on Fly with a Neon database. The problem that I'm facing right now is that the database is using 18 GB of storage, which is pretty expensive. Is there any way to clean up completed runs from the database?

hushed coral
#

We don't have anything off the shelf that you can run. But you can go ahead and write a postgres query that deletes items from the JobRun table that have completed and are old. Same for the Task table.

I'd delete the Task table entries first because of the relationships.

#

We use AWS Aurora for the cloud and so don't really have this problem. Storage is extremely cheap there compared with the things that limit the throughput at our scale like CPU, RAM and replicas

#

I'd be keen to hear what you end up doing so we can share it with other people who require this sort of thing.

odd ingot
#

Hi! Thank you for letting me know. Yes, I was doing that, deleting manually all the records from that database, but I think there are too many. Currently, the JobRun table has 394,984 rows with the SUCCESS status.