gitea/models
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 Artifacts download api for artifact actions v4 (#33510) 2025-02-16 08:32:54 +08:00
activities Add missed auto merge feed message on dashboard (#33309) 2025-01-26 18:33:05 +00:00
admin Fix javascript error when an anonymous user visiting migration page (#32144) 2024-10-02 04:37:16 +00:00
asymkey Move commits signature and verify functions to service layers (#33605) 2025-02-16 12:24:07 +00:00
auth Refactor tests (#33021) 2024-12-29 01:05:56 +00:00
avatars Replace 10 more gt- classes with tw- (#29945) 2024-03-22 13:45:10 +00:00
db Refactor context flash msg and global variables (#33375) 2025-01-25 14:36:47 +00:00
dbfs Enable `unparam` linter (#31277) 2024-06-11 18:47:45 +00:00
fixtures Move issue pin to an standalone table for querying performance (#33452) 2025-02-17 11:28:37 -08:00
git Move commits signature and verify functions to service layers (#33605) 2025-02-16 12:24:07 +00:00
issues Move issue pin to an standalone table for querying performance (#33452) 2025-02-17 11:28:37 -08:00
migrations Move issue pin to an standalone table for querying performance (#33452) 2025-02-17 11:28:37 -08:00
organization Worktime tracking for the organization level (#19808) 2025-02-03 01:51:12 +08:00
packages Add API to support link package to repository and unlink it (#33481) 2025-02-16 19:18:00 -08:00
perm Support public code/issue access for private repositories (#33127) 2025-01-14 01:53:34 +00:00
project 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
renderhelper Refactor render system (orgmode) (#32671) 2024-11-29 16:08:29 +08:00
repo Refactor repository transfer (#33211) 2025-01-30 05:40:44 +00:00
secret Clarify Actions resources ownership (#31724) 2024-08-01 09:04:04 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
system chore: fix some trivial problems and TODOs (#33473) 2025-02-02 18:16:56 +00:00
unit Add `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options (#32416) 2024-11-11 00:11:00 +00:00
unittest Refactor ref type (#33242) 2025-01-14 15:35:34 +08:00
user Fix bug when get commit (#33602) 2025-02-15 15:16:19 -08:00
webhook Refactor webhook events (#33337) 2025-01-23 18:53:06 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
repo.go Fix issue comment number (#30556) 2024-12-30 14:35:46 -08:00
repo_test.go Fix issue comment number (#30556) 2024-12-30 14:35:46 -08:00