Learn which OpenMetadata database tables grow over time, how to limit the audit log table, whether it is safe to purge old rows, and what to do when the entity version history table grows large.
Manage Backend Database Growth
Two tables in the OpenMetadata backend database can grow large over time: audit_log_event (the audit log) and entity_extension (entity version history and custom properties). This page explains how to keep each one under control, and when it is safe to delete rows.
Audit Log Table
The audit_log_event table stores the events that appear on the Audit Logs page. Only the audit log API, the audit log export, and the Audit Logs page read this table. No other table refers to it, and it has no foreign keys.
Limit the Table Size
The Data Retention application deletes audit log rows that are older than a retention period you set. You need administrator access.
Click the Profile icon and navigate to Settings > Applications > Data Retention.
Click Configuration.
Set Audit Log Retention Period (days). The default is 90 days. The minimum is 1.
Save the configuration.
The application runs weekly, on Sundays at midnight. To apply the change sooner, open the application details and select Run Now. For more information, see Configure Data Retention.
Is It Safe to Delete Old Rows?
Yes. Nothing else in OpenMetadata depends on these rows.
The purge permanently deletes the rows. OpenMetadata does not archive them, and you cannot restore them. To keep the history, export the audit logs first. Use the export on the Audit Logs page, or call GET /v1/audit/logs/export. For more information, see Export Audit Logs.
The purge deletes up to 10,000 rows at a time, starting with the oldest, based on the indexed created_at column.
If the Table Is Still Very Large
A very large audit_log_event table usually means one of these:
The Data Retention application is not installed.
Someone changed the retention period to a large value.
The application runs do not finish.
Check these items:
In Settings > Applications > Data Retention > Configuration, confirm the value of Audit Log Retention Period (days).
In the application details, review the status of the latest runs. Look for runs that fail or never complete.
Run this query on the database to see how many rows exist and how old they are. The created_at column holds a time in milliseconds since 1 January 1970 (epoch milliseconds).
SELECT count(*), min(created_at), max(created_at) FROM audit_log_event;
If min(created_at) is older than your retention period and runs complete without errors, contact support.
Entity Version History Table
OpenMetadata saves every version of an entity, and the values of custom properties, in the entity_extension table. It does not save them in the change event table. For this reason, the change event retention setting does not make entity_extension smaller.
The Data Retention application cleans up only operational records, such as change events and audit logs. Entity versions are not a retention target, and you cannot configure a retention period for them.
OpenMetadata has no supported cleanup for this table today.
Do not delete rows from entity_extension with SQL. The version API reads these rows directly, so deleting them breaks the version history of the affected entities.
If this table grows large, contact support before you change anything. Share the size of the table and the number of entities in your deployment.