Octopus Database - Events table cleanup


TL/DR: Events table growing fast. How to clean it up safely?


We’re generating millions of Octopus events per month, because we have many automated processes that generate many actions through the API, specifically tons of artifacts creation/deletion.

I’ve looked into the biggest tables, and by far the Events table is the biggest.
Total DB size is 65GB and growing every day.

Is there some official documentation and SQL query on how to clean up the Events table?
If possible, I’d like to target some specific events (artifacts).

Hi Damien,

Thanks for getting in touch!

Whilst we don’t recommend manually interacting with the DB, we recognise that the events table is a pain point for many customers.
Our best practice for this would be to create a new table and move/archive items from your events table to reduce the size but still retain the data.

In release 2023.3 (currently aiming for early September) we will be including an audit log archiving feature which would resolve this problem for you if you are able to wait until then.


Ok that’s great news!
I’m not too keen on deleting data directly in the DB either.
We will wait until you guys release the archiving feature then.



This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.