Skip to content
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

Improve indices for action table #23532

Merged
merged 3 commits into from
Mar 24, 2023
Merged

Conversation

Zettat123
Copy link
Contributor

@Zettat123 Zettat123 commented Mar 17, 2023

Close #21611

Add the index mentioned in #21611 (comment) . Since we already have an index for ("created_unix", "user_id", "is_deleted") columns on PostgreSQL, I removed the database type check to apply this index to all types of databases.

@Zettat123
Copy link
Contributor Author

@zeripath I noticed that in #21033 you created the c_u_d index but I'm not sure why this index is only applied to PostgreSQL. Could you please help to check whether the index could be added to other dbs?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 17, 2023
@lunny lunny added the performance/speed performance issues with slow downs label Mar 17, 2023
@zeripath
Copy link
Contributor

@zeripath I noticed that in #21033 you created the c_u_d index but I'm not sure why this index is only applied to PostgreSQL. Could you please help to check whether the index could be added to other dbs?

Why don't you check?

I added the c_u_d index to postgres because in my testing MySQL and others didn't appear to need it. Have you tested it? Does it improve your databases?

@Zettat123
Copy link
Contributor Author

Have you tested it?

Yes, I have tested it in my MySQL database. There are about 300,000 records in the action table and the new index reduces the load time from about 700ms to about 150ms.
Another user also tested this index, in their MySQL database, the new index can reduce the load time from about 7000ms to about 500ms.

@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 Mar 20, 2023
@lunny lunny added this to the 1.20.0 milestone Mar 20, 2023
@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 Mar 24, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 24, 2023
@lunny lunny merged commit b958dba into go-gitea:main Mar 24, 2023
@lunny lunny removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 24, 2023
@Zettat123 Zettat123 deleted the bugfix/issue-21611 branch March 27, 2023 03:47
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 27, 2023
* upstream/main: (23 commits)
  Fix project card preview select and template select (go-gitea#23684)
  [skip ci] Updated translations via Crowdin
  Add git dashes separator to some "log" and "diff" commands (go-gitea#23606)
  Add Simplified Chinese translate for oauth2-provider (go-gitea#23713)
  Fix incorrect `toggle` buttons (go-gitea#23676)
  Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (go-gitea#23626)
  Allow new file and edit file preview if it has editable extension (go-gitea#23624)
  [skip ci] Updated translations via Crowdin
  Clean some legacy files and move some build files (go-gitea#23699)
  Remove row clicking from notification table (go-gitea#22695)
  Describe Gitea's purpose more accurately (go-gitea#23698)
  [skip ci] Updated translations via Crowdin
  ensure go/bin path exists when copying hugo bin into it (go-gitea#23692)
  Create commit status when event is `pull_request_sync` (go-gitea#23683)
  Add `deps-docs` command to makefile (go-gitea#23686)
  Fix incorrect package doc link (go-gitea#23679)
  Improve indices for `action` table (go-gitea#23532)
  Clarify that Gitea requires JavaScript (go-gitea#23677)
  Use data-tooltip-content for tippy tooltip (go-gitea#23649)
  Add aria attributes to interactive time tooltips. (go-gitea#23661)
  ...
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. performance/speed performance issues with slow downs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User dashboard takes a long time to load since 1.17
5 participants