You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
1 week ago
..
actions Artifacts download api for artifact actions v4 (#33510) 1 week ago
activities Add missed auto merge feed message on dashboard (#33309) 4 weeks ago
admin Fix javascript error when an anonymous user visiting migration page (#32144) 5 months ago
asymkey Move commits signature and verify functions to service layers (#33605) 1 week ago
auth Refactor tests (#33021) 2 months ago
avatars Replace 10 more gt- classes with tw- (#29945) 11 months ago
db Refactor context flash msg and global variables (#33375) 1 month ago
dbfs Enable `unparam` linter (#31277) 9 months ago
fixtures Move issue pin to an standalone table for querying performance (#33452) 1 week ago
git Move commits signature and verify functions to service layers (#33605) 1 week ago
issues Move issue pin to an standalone table for querying performance (#33452) 1 week ago
migrations Move issue pin to an standalone table for querying performance (#33452) 1 week ago
organization Worktime tracking for the organization level (#19808) 3 weeks ago
packages Add API to support link package to repository and unlink it (#33481) 1 week ago
perm Support public code/issue access for private repositories (#33127) 1 month ago
project Fix project issues list and counting (#33594) 1 week ago
pull Automerge supports deleting branch automatically after merging (#32343) 2 months ago
renderhelper Refactor render system (orgmode) (#32671) 3 months ago
repo Refactor repository transfer (#33211) 4 weeks ago
secret Clarify Actions resources ownership (#31724) 7 months ago
shared/types Refactor locale&string&template related code (#29165) 1 year ago
system chore: fix some trivial problems and TODOs (#33473) 3 weeks ago
unit Add `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options (#32416) 4 months ago
unittest Refactor ref type (#33242) 1 month ago
user Fix bug when get commit (#33602) 1 week ago
webhook Refactor webhook events (#33337) 1 month ago
main_test.go make writing main test easier (#27270) 1 year ago
repo.go Fix issue comment number (#30556) 2 months ago
repo_test.go Fix issue comment number (#30556) 2 months ago