Events Table Maintenance
The size on disk of the GreenArrow
events table in Postgres can grow over
time, particularly if there is a service interruption with events delivery.
Periodically, the GreenArrow Event Notification System will rewrite the
events table to reduce this bloat if it accumulates. This is done only
if events are being actively delivered (there are no more than 100,000 events
in the queue) and if the table appears to be bloated.
If you recognize a need for the
events table to be rewritten and it has
not automatically happened, you can manually invoke the
greenarrow shrink_events_table command.
$ greenarrow shrink_events_table
- installing events trigger
- waiting for events table to be freed of transactions
- moving data from events to events__defrag1
- waiting for events__defrag2 table to be freed of transactions
- moving data from events__defrag2 back to events
- recording time of events table shrink
- events table shrink is complete