roryqi opened a new pull request, #14356:
URL: https://github.com/apache/gravitino/pull/14356

   ### What changes were proposed in this pull request?
   
   Add indexes leading with `role_id` in the 2.0.0 schemas and 1.3.0-to-2.0.0 
upgrades:
   
   - PostgreSQL: `user_role_rel` and `group_role_rel`.
   - MySQL and H2: `group_role_rel`; `user_role_rel` already has the index.
   
   Keep the MySQL upgrade retryable by checking for an existing index leading 
with `role_id`. Extend `TestSQLScripts` to verify these indexes after fresh 
installation and upgrade.
   
   ### Why are the changes needed?
   
   Deleting a role soft-deletes both relation tables by `role_id`. Without a 
leading index, these updates scan the relation tables and slow down role 
deletion as assignments grow.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No API or configuration changes.
   
   ### How was this patch tested?
   
   24 tests passed across H2, MySQL 8.0, and PostgreSQL 13. Formatting and diff 
checks passed.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to