gitea/services
Lunny Xiao 7df09e31fa
Move issue pin to an standalone table for querying performance (#33452)
Noticed a SQL in gitea.com has a bigger load. It seems both `is_pull`
and `pin_order` are not indexed columns in the database.

```SQL
SELECT `id`, `repo_id`, `index`, `poster_id`, `original_author`, `original_author_id`, `name`, `content`, `content_version`, `milestone_id`, `priority`, `is_closed`, `is_pull`, `num_comments`, `ref`, `pin_order`, `deadline_unix`, `created_unix`, `updated_unix`, `closed_unix`, `is_locked`, `time_estimate` FROM `issue` WHERE (repo_id =?) AND (is_pull = 0) AND (pin_order > 0) ORDER BY pin_order
```

I came across a comment
https://github.com/go-gitea/gitea/pull/24406#issuecomment-1527747296
from @delvh , which presents a more reasonable approach. Based on this,
this PR will migrate all issue and pull request pin data from the
`issue` table to the `issue_pin` table. This change benefits larger
Gitea instances by improving scalability and performance.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-17 11:28:37 -08:00
..
actions Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
agit User facing messages for AGit errors (#33012) 2025-01-27 02:33:39 +00:00
asymkey Move commits signature and verify functions to service layers (#33605) 2025-02-16 12:24:07 +00:00
attachment Include file extension checks in attachment API (#32151) 2024-11-06 21:34:32 +00:00
auth Fix context usage (#33554) 2025-02-11 16:46:03 +08:00
automerge Automerge supports deleting branch automatically after merging (#32343) 2025-01-10 03:51:03 +08:00
context Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
contexttest Avoid duplicate SetContextValue call (#33564) 2025-02-12 14:25:46 +08:00
convert Move issue pin to an standalone table for querying performance (#33452) 2025-02-17 11:28:37 -08:00
cron Use default Git timeout when checking repo health (#33593) 2025-02-14 15:13:56 +00:00
doctor Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
externalaccount allow synchronizing user status from OAuth2 login providers (#31572) 2024-07-16 20:33:16 +02:00
feed Refactor RefName (#33234) 2025-01-13 14:01:53 +08:00
forms Fix commit status events (#33320) 2025-02-04 03:25:59 +00:00
git Move commits signature and verify functions to service layers (#33605) 2025-02-16 12:24:07 +00:00
gitdiff Performance optimization for pull request files loading comments attachments (#33585) 2025-02-14 06:49:58 +00:00
indexer Update issue indexer after merging a PR (#30715) 2024-05-08 14:45:15 +00:00
issue Move issue pin to an standalone table for querying performance (#33452) 2025-02-17 11:28:37 -08:00
lfs Fix SSH LFS memory usage (#33455) 2025-01-31 19:05:48 +08:00
mailer Move commits signature and verify functions to service layers (#33605) 2025-02-16 12:24:07 +00:00
markup Fix context usage (#33554) 2025-02-11 16:46:03 +08:00
migrations refactor: decouple context from migration structs (#33399) 2025-02-07 05:37:32 +00:00
mirror Fix mirror bug (#33597) 2025-02-15 18:29:44 +08:00
notify Refactor repository transfer (#33211) 2025-01-30 05:40:44 +00:00
oauth2_provider Introduce OrgList and add LoadTeams, optimaze Load teams for orgs (#32543) 2024-11-26 21:55:06 +00:00
org Refactor tests (#33021) 2024-12-29 01:05:56 +00:00
packages Add API to support link package to repository and unlink it (#33481) 2025-02-16 19:18:00 -08:00
projects Fix project issues list and counting (#33594) 2025-02-17 05:14:56 +00:00
pull Automerge supports deleting branch automatically after merging (#32343) 2025-01-10 03:51:03 +08:00
release Refactor "string truncate" (#32984) 2024-12-26 11:56:03 +08:00
repository Move issue pin to an standalone table for querying performance (#33452) 2025-02-17 11:28:37 -08:00
secrets Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
task Fix "force private" logic (#31012) 2024-05-20 00:56:45 +00:00
uinotification Penultimate round of `db.DefaultContext` refactor (#27414) 2023-10-11 04:24:07 +00:00
user Refactor repository transfer (#33211) 2025-01-30 05:40:44 +00:00
webhook Fix commit status events (#33320) 2025-02-04 03:25:59 +00:00
webtheme Initial support for colorblindness-friendly themes (#30625) 2024-04-24 00:18:41 +08:00
wiki Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00