Conversation
…eval - Updated the available entries partial to include associated entry files and categories, optimizing data loading for better performance. - Modified the selected entries partial to include category and entry file attachments in the EntryRanking query, ensuring all necessary data is preloaded. - Refined the JudgeDashboardController to include categories and entry file attachments in the entries query, reducing N+1 query issues and improving overall efficiency. These changes enhance the user experience by providing richer data in the dashboard while optimizing database interactions.
…dController - Introduced a new test case to verify that entry file attachments are eager loaded in the index action, reducing N+1 query issues. - The test ensures that the number of SQL queries for attachments does not exceed two, optimizing performance during data retrieval. These changes enhance the test coverage for the JudgeDashboardController, ensuring efficient loading of associated data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the judge dashboard by optimizing database queries related to contest entries, especially for loading entry file attachments and categories. The main focus is on reducing N+1 query issues by eager loading associated data, which will improve performance and efficiency when judges view and rank entries.
Key improvements:
Performance and Query Optimization:
indexaction injudge_dashboard_controller.rbto eager loadcategoryandentry_file_attachment(with blobs) for each entry, reducing N+1 queries when loading contest entries._available_entries.html.erbpartial to usewith_attached_entry_fileand eager loadcategoryfor entries, further minimizing database queries when rendering available entries for judges._selected_entries.html.erbpartial to eager loadcategoryandentry_file_attachment(with blobs) for ranked entries, ensuring efficient data retrieval when displaying selected entries.Testing and Verification: