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/services/repository
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
..
archiver Refactor context RefName and RepoAssignment (#33226) 1 month ago
commitstatus Add new event commit status creation and webhook implementation (#27151) 4 months ago
files Move commits signature and verify functions to service layers (#33605) 1 week ago
gitgraph Move commits signature and verify functions to service layers (#33605) 1 week ago
adopt.go Fix various problems (artifact order, api empty slice, assignee check, fuzzy prompt, mirror proxy, adopt git) (#33569) 2 weeks ago
adopt_test.go Reduce integration test overhead (#32475) 3 months ago
avatar.go Fix repo avatar conflict (#32958) 2 months ago
avatar_test.go Fix repo avatar conflict (#32958) 2 months ago
branch.go Improve sync fork behavior (#33319) 1 month ago
cache.go Always enable caches (#28527) 1 year ago
check.go Refactor pprof labels and process desc (#32909) 2 months ago
collaboration.go Move team related functions to service layer (#32537) 3 months ago
collaboration_test.go Move AddCollabrator and CreateRepositoryByExample to service layer (#32419) 4 months ago
commit.go Move context from modules to services (#29440) 1 year ago
contributors_graph.go Enable more `revive` linter rules (#30608) 10 months ago
contributors_graph_test.go disable gravatar in test (#32529) 3 months ago
create.go Make git clone URL could use current signed-in user (#33091) 2 months ago
delete.go Move issue pin to an standalone table for querying performance (#33452) 1 week ago
delete_test.go Delete repos of org when purge delete user (#27273) 1 year ago
fork.go Fix system admin cannot fork or get private fork with API (#33401) 4 weeks ago
fork_test.go Add option to prohibit fork if user reached maximum limit of repositories (#21848) 2 years ago
generate.go Make git clone URL could use current signed-in user (#33091) 2 months ago
generate_test.go Move generate from module to service (#29465) 1 year ago
hooks.go Simplify how git repositories are opened (#28937) 1 year ago
init.go Refactor pprof labels and process desc (#32909) 2 months ago
lfs.go Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294) 1 year ago
lfs_test.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
license.go Support repo license (#24872) 5 months ago
license_test.go Enable tenv and testifylint rules (#32852) 2 months ago
main_test.go make writing main test easier (#27270) 1 year ago
merge_upstream.go Improve sync fork behavior (#33319) 1 month ago
migrate.go Support the new exit code for `git remote` subcommands for git version >=2.30.0 (#33129) 2 months ago
push.go Automerge supports deleting branch automatically after merging (#32343) 2 months ago
repo_team.go Move RepoTransfer from models to models/repo sub package (#32506) 2 months ago
repo_team_test.go Move team related functions to service layer (#32537) 3 months ago
repository.go Support repo license (#24872) 5 months ago
repository_test.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
setting.go Fix an actions schedule bug (#28942) 1 year ago
template.go Move generate from module to service (#29465) 1 year ago
transfer.go Refactor repository transfer (#33211) 4 weeks ago
transfer_test.go Refactor repository transfer (#33211) 4 weeks ago