Skip to content

Prepare and backfill a clean replacement table for oauth_access_grants

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Follow-up of #377995 (closed)

Proposal

We'll introduce a new unpartitioned table oauth_access_grants_clean that mirrors the oauth_access_grants table's schema. Then we'll add a trigger to sync the I/O operations and later backfill valid records into the table. This will then replace the original table oauth_access_grants to reclaim the space.

Steps

Adapted from description of this issue:

  • Create oauth_access_grants_clean table
    • Schema exactly mirrors oauth_access_grants
    • NOT partitioned
  • Add triggers to oauth_access_grants table that sync I/O ops to oauth_access_grants_clean
    • Every read/write/update/delete operation propagates to oauth_access_grants_clean
  • Create a migration to backfill existing records from oauth_access_grants to oauth_access_grants_clean.

Note

The scope of this issue might change in case pg_repack is going to be available.

Edited by 🤖 GitLab Bot 🤖