forgejo/models/activities
Paweł Bogusławski 7380eac5a2 fix: improve dashboard loading performances (#7604)
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>
2025-06-14 23:01:56 +02:00
..
action.go fix: improve dashboard loading performances (#7604) 2025-06-14 23:01:56 +02:00
action_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
action_test.go fix: improve dashboard loading performances (#7604) 2025-06-14 23:01:56 +02:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
notification.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
notification_list.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
notification_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repo_activity.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_activity_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
statistic.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
user_heatmap.go fix: include activity needed for entire heatmap (#7893) 2025-05-21 05:25:39 +02:00
user_heatmap_test.go fix: include activity needed for entire heatmap (#7893) 2025-05-21 05:25:39 +02:00