Skip to content

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:

normal

When adding 2 users:

normal_multiple:

SQL queries used with the optimization (Only SQL queries)

When adding 1 user:

Screen_Shot_2017-09-04_at_12.12.13_AM

When adding 2 users:

Screen_Shot_2017-09-04_at_12.12.56_AM

SQL queries used with the optimization (With a background job for post_create_hook)

NOT INCLUDED IN THIS MR

When adding 1 user:

optimized

When adding 2 users:

optimized_multiple

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #27374 (closed)

Edited by Rubén Dávila

Merge request reports

Loading