Optimize Groups::GroupMembersController#create
What does this MR do?
Reduces the number of SQL queries triggered in this endpoint and moves to a background job some post creation queries that are made against large tables like notification_settings
.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Endpoint was slow due to the number of SQL queries used.
Screenshots (if relevant)
SQL queries used without the optimization
When adding 1 user:
When adding 2 users:
SQL queries used with the optimization (Only SQL queries)
When adding 1 user:
When adding 2 users:
SQL queries used with the optimization (With a background job for post_create_hook)
NOT INCLUDED IN THIS MR
When adding 1 user:
When adding 2 users:
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Closes #27374 (closed)
Edited by Rubén Dávila