Skip to content

Improve database response time for listing user activity

Andreas Brandl requested to merge 40525-listing-user-activity-timeouts into master

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?

  1. Please double-check permissions are still respected properly.
  2. 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?

What are the relevant issue numbers?

Closes #40525 (closed)

Edited by Yorick Peterse

Merge request reports