-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development
: Avoid database queries with pagination and left join fetch
#8741
Conversation
WalkthroughRecent updates across multiple repository files significantly enhance data retrieval efficiency and optimize query performance for various entities such as programming submissions, results, and users. New methods have been introduced, and existing ones have been refactored for improved functionality and clarity. These changes collectively aim to streamline access to data and boost overall system performance, particularly within the context of programming exercises and user management. Changes
Sequence Diagram(s)Sequence Diagram for Programming Submission Result RetrievalsequenceDiagram
participant Student as Student
participant CourseOverview as CourseOverview
participant ProgrammingSubmissionRepository as ProgrammingSubmissionRepository
Student->>CourseOverview: request latest submission results
CourseOverview->>ProgrammingSubmissionRepository: findFirstIdByParticipationIdOrderBySubmissionDateDesc(participationId, Pageable)
ProgrammingSubmissionRepository-->>CourseOverview: List<ProgrammingSubmissionIdAndSubmissionDateDTO>
CourseOverview-->>Student: display latest submission results
Possibly Related Issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
src/main/java/de/tum/in/www1/artemis/repository/iris/IrisMessageRepository.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS6 and didn't encounter any issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the extensive usage of derived queries 👍
LGTM
Checklist
General
Server
Motivation and Context
Pagination combined with fetching ("left join fetch") leads to potential performance issues (see https://vladmihalcea.com/hibernate-query-fail-on-pagination-over-collection-fetch) and to ugly warnings in the logs
HHH90003004: firstResult/maxResults specified with collection fetch; applying in memory
Description
hibernate.query.fail_on_pagination_over_collection_fetch: true
in the src and test code to find all places that combine pagination with left join fetch.order by
), we might need to make sure that the custom order is maintained in the second query of afterwards in Java.A good example of this (based on the Specification API) can be found in the changes of #5257.
Steps for Testing
The database queries could influence these parts of the application:
You can test one of them.
I created a course with all types of exercises on ts5 in my test course, and you can take an exam there as well.
Also, you are welcome to test other features that are not mentioned in this list.
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Review Progress
Code Review
Manual Tests
Exam Mode Test
Test Coverage
Server
Client coverage was not changed.
Summary by CodeRabbit
Bug Fixes
New Features
Refactor
Documentation
Chores