Improve database response time for listing user activity
What does this MR do?
This MR improves a database query to display activity of a given user to the currently logged in user. It leverages the user_interacted_tables
table introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17327.
Are there points in the code the reviewer needs to double check?
- Please double-check permissions are still respected properly.
- Also, I ditched the
LATERAL
join because https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17454#note_61882724 -- anything I'm not seeing?
Why was this MR needed?
For some users, displaying the user activity page times out. That is, the related query runs into the statement timeout.
A URL to test this is https://gitlab.com/ather-embitel (note we fail to show something for 'most recent activity' after a while).
Grafana links: Controller performance
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - Review
-
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 -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #40525 (closed)
Edited by Yorick Peterse