Skip to content

Filter reviews of one pull request in memory instead of database to reduce slow response because of lacking database index #33106

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

Merged
merged 10 commits into from
Jan 7, 2025

Conversation

lunny
Copy link
Member

@lunny lunny commented Jan 5, 2025

This PR fixes a performance problem when reviewing a pull request in a big instance which have many records in the review table. Traditionally, we should add more indexes in that table. But since dismissed reviews of 1 pull request will not be too many as expected in a common repository. Filtering reviews in the memory should be more quick .

@lunny lunny added performance/speed performance issues with slow downs backport/v1.23 This PR should be backported to Gitea 1.23 labels Jan 5, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 5, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jan 5, 2025
@lunny lunny force-pushed the lunny/fix_pr_view_loadreviewers branch from 654fa95 to 1235dbc Compare January 5, 2025 18:16
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 5, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 7, 2025
@lunny lunny merged commit 98637fe into go-gitea:main Jan 7, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Jan 7, 2025
@lunny lunny deleted the lunny/fix_pr_view_loadreviewers branch January 7, 2025 02:50
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jan 7, 2025
…educe slow response because of lacking database index (go-gitea#33106)

This PR fixes a performance problem when reviewing a pull request in a
big instance which have many records in the `review` table.
Traditionally, we should add more indexes in that table. But since
dismissed reviews of 1 pull request will not be too many as expected in
a common repository. Filtering reviews in the memory should be more
quick .

---------

Co-authored-by: wxiaoguang <[email protected]>
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jan 7, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 8, 2025
* giteaofficial/main:
  add submodule diff links (go-gitea#33097)
  [skip ci] Updated translations via Crowdin
  Update status check for all supported on.pull_request.types in Gitea (go-gitea#33117)
  Support the new exit code for `git remote` subcommands for git version >=2.30.0 (go-gitea#33129)
  Make git clone URL could use current signed-in user (go-gitea#33091)
  Filter reviews of one pull request in memory instead of database to reduce slow response because of lacking database index (go-gitea#33106)
lunny added a commit that referenced this pull request Jan 8, 2025
…educe slow response because of lacking database index (#33106) (#33128)

Backport #33106 by @lunny

This PR fixes a performance problem when reviewing a pull request in a
big instance which have many records in the `review` table.
Traditionally, we should add more indexes in that table. But since
dismissed reviews of 1 pull request will not be too many as expected in
a common repository. Filtering reviews in the memory should be more
quick .

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Apr 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code performance/speed performance issues with slow downs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants