Drop updated_at column on audit_events
Problem to solve
Audit events should be append-only. The updated_at
field is redundant and can be dropped to save storage spaces and reduce query payload.
Proposal
Drop updated_at
column from audit_events
table.
This change will be more likely to be spread across multiple releases (https://docs.gitlab.com/ee/development/what_requires_downtime.html#dropping-columns)
-
13.2: Ignore updated_at
column and stop all writes -
13.3: Remove updated_at
column onaudit_events
-
13.4: Clean up ignore column code in AuditEvent
model
Further details
This will shave a shy (242,000,000 mil records * 8 bytes) in Gb = 2.2352 Gb
- https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/9226#master-1022016106-18
- https://www.postgresql.org/docs/11/datatype-datetime.html
Availability & Testing
There is no known consumer of this field. Both UI and API only allow querying and presenting of created_at
field.
Require collaboration with groupdatabase to understand if there is any risk.
Edited by Tan Le