Skip to content

Drop stale Pulp RBAC indexes on core_userrole and core_grouprole#2691

Open
amasolov wants to merge 1 commit intoansible:mainfrom
amasolov:cleanup/remove-stale-pulp-rbac-indexes
Open

Drop stale Pulp RBAC indexes on core_userrole and core_grouprole#2691
amasolov wants to merge 1 commit intoansible:mainfrom
amasolov:cleanup/remove-stale-pulp-rbac-indexes

Conversation

@amasolov
Copy link
Copy Markdown

@amasolov amasolov commented Apr 8, 2026

What is this PR doing:

Adds migration 0060 that drops 10 stale indexes on core_userrole and core_grouprole tables. These tables have zero rows after the DAB RBAC transition, and their non-PK indexes have zero scans.

The migration uses RunSQL with DROP INDEX IF EXISTS for safety and is fully reversible. The tables themselves are left intact (owned by pulpcore).

No-Issue

Reviewers must know:

  • Only indexes are dropped; no tables or columns are modified
  • Tables core_userrole and core_grouprole are owned by pulpcore but have zero rows post-DAB-RBAC migration
  • Indexes dropped (all with idx_scan = 0):
    • core_userrole_content_type_id_a2ff8402
    • core_userrole_domain_id_f78b1c11
    • core_userrole_role_id_8272b20d
    • core_userrole_user_id_aca63c51
    • core_userro_content_5c0477_idx
    • core_grouprole_content_type_id_a80c1cfc
    • core_grouprole_domain_id_9644db4b
    • core_grouprole_group_id_09264d71
    • core_grouprole_role_id_3c2c3564
    • core_groupr_content_ea7d37_idx

Made with Cursor

After Hub transitioned to DAB RBAC, the old Pulp RBAC assignment
tables core_userrole and core_grouprole have zero rows and their
non-PK/non-unique indexes have zero scans. These 10 indexes are
dead weight that slows VACUUM and adds planner overhead.

This migration drops 10 stale indexes on these tables via RunSQL.
The tables themselves are left intact (owned by pulpcore). The
migration is fully reversible.

Signed-off-by: Artem Masolov <amasolov@redhat.com>
Signed-off-by: Alexey Masolov <alexey.masolov@gmail.com>
Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant