How do I clean up older data from the database? #12047
-
After using |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
One option is to use the python APIs against the Perform this operation with great care. An example script would look something like this.
|
Beta Was this translation helpful? Give feedback.
-
Will this trigger the relevant cleanup to take place as well (like |
Beta Was this translation helpful? Give feedback.
-
If I want to keep ASSET_MATERIALIZATION and ASSET_OBSERVATION event for UI, is there a way to keep them? |
Beta Was this translation helpful? Give feedback.
-
Is there a clean way to also remove the associated folders on disk? I have a disk that's slowly getting filled up with the contents of intermediate results of runs. |
Beta Was this translation helpful? Give feedback.
-
Just for inspiration, we are currently cleaning up the disk by blindly deleting storage older than 30 days.
No guarantee this is a good idea, I can only confirm this hasn't broken our production instance (yet). |
Beta Was this translation helpful? Give feedback.
One option is to use the python APIs against the
DagsterInstance
to query for older runs and delete them. This is a destructive operation that will remove the events, tags, and run record from the database. This will removedagster
s understanding that this run ever occurred, which can be particularly impactful to partitioned jobs and assets.Perform this operation with great care.
An example script would look something like this.