spotify / XCMetrics

XCMetrics is the easiest way to collect Xcode build metrics and improve developer productivity.
https://xcmetrics.io
Other
1.1k stars 77 forks source link

How to delete old data #41

Closed user646346 closed 3 years ago

user646346 commented 3 years ago

Hello, Im trying to use docker-compose-local.yml and my postgres database is growing Is there any build in solution to delete old data? Or I can just drop old partitions?

BalestraPatrick commented 3 years ago

You can just drop partitions if you don't need the data. Make sure to have backups otherwise somewhere else. We never delete our data so we haven't had the need to do this, but you keep in mind that you'll need to drop all partitions from all tables for the same days. You can likely do it with some magic queries to drop them all automatically.

user646346 commented 3 years ago

Thanks

1ucas commented 3 years ago

I'm in the same situation here.

To keep a weekly report, is it safe to just

DELETE FROM build_XYZ
WHERE day < (now() - '7'::interval)

on all tables starting with the "build" prefix?

I should keep "job_entries" and "migrations" untouched, right?