gitea/models/activities
Lunny Xiao a4df01b580
Optimize total count of feed when loading activities in user dashboard. (#33841)
Two SQLs are very slow when `action` table have over 5M records.

```
database duration=1.8881s db.sql="SELECT created_unix DIV 900 * 900 AS timestamp, count(user_id) as contributions FROM `action` WHERE user_id=? AND act_user_id=? AND (created_unix > ?) GROUP BY timestamp ORDER BY timestamp"

database duration=1.5408s db.sql="SELECT count(*) FROM `action` WHERE (user_id = ?) AND (is_deleted = ?)"
```

This will cache the count for the first loading or when the activities
changed.
2025-03-20 10:46:18 -07:00
..
action.go Optimize total count of feed when loading activities in user dashboard. (#33841) 2025-03-20 10:46:18 -07:00
action_list.go Optimize total count of feed when loading activities in user dashboard. (#33841) 2025-03-20 10:46:18 -07:00
action_test.go Move notifywatch to service layer (#33825) 2025-03-10 00:54:25 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
notification.go Perf: add extra index to notification table (#32395) 2024-11-13 18:17:54 +00:00
notification_list.go Refactor more filterslice (#30370) 2024-04-10 04:18:41 +00:00
notification_test.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
repo_activity.go Fix bug on activities (#33008) 2024-12-28 04:04:07 +00:00
statistic.go Rename project board -> column to make the UI less confusing (#30170) 2024-05-27 08:59:54 +00:00
user_heatmap.go Move GetFeeds to service layer (#32526) 2024-11-29 17:53:49 +00:00
user_heatmap_test.go Refactor tests (#33021) 2024-12-29 01:05:56 +00:00