mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-07-21 22:00:02 +02:00

Generating dashboard page takes too long when table `action` contains many records and error log contains message like ``` 2025/04/21 21:21:07 ...activities/action.go:470:GetFeeds() [W] [Slow SQL Query] SELECT `action`.* FROM `action` INNER JOIN `repository` ON `repository`.id = `action`.repo_id WHERE user_id=? AND is_deleted=? ORDER BY `action`.`created_unix` DESC LIMIT 20 [12 false] - 2m8.393454675s ``` This mod removes unnecessary inner join like proposed in https://github.com/go-gitea/gitea/pull/32127 For complete solution index(user_id, is_deleted) for action table should be created also like in https://github.com/go-gitea/gitea/pull/32333 (not included in this mod). Related: https://github.com/go-gitea/gitea/pull/32127 Related: https://github.com/go-gitea/gitea/pull/32333 Author-Change-Id: IB#1160173 ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [x] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [ ] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7604 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Paweł Bogusławski <pboguslawski@noreply.codeberg.org> Co-committed-by: Paweł Bogusławski <pboguslawski@noreply.codeberg.org>
76 lines
No EOL
1.3 KiB
YAML
76 lines
No EOL
1.3 KiB
YAML
-
|
|
id: 1
|
|
user_id: 2
|
|
op_type: 12 # close issue
|
|
act_user_id: 2
|
|
repo_id: 2 # private
|
|
is_private: true
|
|
created_unix: 1603228283
|
|
content: '1|' # issueId 4
|
|
|
|
-
|
|
id: 2
|
|
user_id: 3
|
|
op_type: 2 # rename repo
|
|
act_user_id: 2
|
|
repo_id: 3 # private
|
|
is_private: true
|
|
content: oldRepoName
|
|
|
|
-
|
|
id: 3
|
|
user_id: 11
|
|
op_type: 1 # create repo
|
|
act_user_id: 11
|
|
repo_id: 9 # public
|
|
is_private: false
|
|
|
|
-
|
|
id: 4
|
|
user_id: 16
|
|
op_type: 12 # close issue
|
|
act_user_id: 16
|
|
repo_id: 22 # private
|
|
is_private: true
|
|
created_unix: 1603267920
|
|
|
|
- id: 5
|
|
user_id: 10
|
|
op_type: 1 # create repo
|
|
act_user_id: 10
|
|
repo_id: 6 # private
|
|
is_private: true
|
|
created_unix: 1603010100
|
|
|
|
- id: 6
|
|
user_id: 10
|
|
op_type: 1 # create repo
|
|
act_user_id: 10
|
|
repo_id: 7 # private
|
|
is_private: true
|
|
created_unix: 1603011300
|
|
|
|
- id: 7
|
|
user_id: 10
|
|
op_type: 1 # create repo
|
|
act_user_id: 10
|
|
repo_id: 8 # public
|
|
is_private: false
|
|
created_unix: 1603011540 # grouped with id:7
|
|
|
|
- id: 8
|
|
user_id: 34
|
|
op_type: 12 # close issue
|
|
act_user_id: 34
|
|
repo_id: 1 # public
|
|
is_private: false
|
|
created_unix: 1680454039
|
|
content: '4|' # issueId 5
|
|
|
|
- id: 10
|
|
user_id: 40
|
|
op_type: 1 # create repo
|
|
act_user_id: 40
|
|
repo_id: 60 # public
|
|
is_private: false
|
|
created_unix: 1577404800 # end of heatmap |