Skip to content

Include user relationship when retrieving award_emoji

Paco Guzman requested to merge 14320-note-grouped_awards into master

What does this MR do?

Reduce timings in the grouped_awards methods or in how we're showing grouped awards later on, avoiding N+1 queries to the users table

Are there points in the code the reviewer needs to double check?

I've decide to load only the award attributes we need name and user_id that's avoid retrieve only database data that we're going to need and later AR instance doesn't need to populate all their attributes. Would be great if in the includes declaration we can define which attribute we expect for the user objects because the code only needs the user name. If we have something like that maybe could help to speed this up.

This method is used in the following template and there you can see we call award_user_listwhich will print out the user name, that's where the N+1 query happens

What are the relevant issue numbers?

Fixes #14320 (closed)

Does this MR meet the acceptance criteria?

Merge request reports

Loading