gitea/routers/api/v1/repo
Lunny Xiao 7df09e31fa
Move issue pin to an standalone table for querying performance ()
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
..
action.go Refactor error system () 2025-02-16 22:13:17 -08:00
avatar.go Refactor error system () 2025-02-16 22:13:17 -08:00
blob.go Refactor error system () 2025-02-16 22:13:17 -08:00
branch.go Refactor error system () 2025-02-16 22:13:17 -08:00
collaborators.go Refactor error system () 2025-02-16 22:13:17 -08:00
commits.go Refactor error system () 2025-02-16 22:13:17 -08:00
compare.go Refactor error system () 2025-02-16 22:13:17 -08:00
download.go Refactor error system () 2025-02-16 22:13:17 -08:00
file.go Refactor error system () 2025-02-16 22:13:17 -08:00
fork.go Refactor error system () 2025-02-16 22:13:17 -08:00
git_hook.go Refactor error system () 2025-02-16 22:13:17 -08:00
git_ref.go Refactor error system () 2025-02-16 22:13:17 -08:00
hook.go Refactor error system () 2025-02-16 22:13:17 -08:00
hook_test.go Remove duplicate "ResponseWriter.Status" method () 2025-01-22 06:37:52 +00:00
issue.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_attachment.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_comment.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_comment_attachment.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_dependency.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_label.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_pin.go Move issue pin to an standalone table for querying performance () 2025-02-17 11:28:37 -08:00
issue_reaction.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_stopwatch.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_subscription.go Refactor error system () 2025-02-16 22:13:17 -08:00
issue_tracked_time.go Refactor error system () 2025-02-16 22:13:17 -08:00
key.go Refactor error system () 2025-02-16 22:13:17 -08:00
label.go Refactor error system () 2025-02-16 22:13:17 -08:00
language.go Refactor error system () 2025-02-16 22:13:17 -08:00
license.go Refactor error system () 2025-02-16 22:13:17 -08:00
main_test.go
migrate.go Refactor error system () 2025-02-16 22:13:17 -08:00
milestone.go Refactor error system () 2025-02-16 22:13:17 -08:00
mirror.go Refactor error system () 2025-02-16 22:13:17 -08:00
notes.go Refactor error system () 2025-02-16 22:13:17 -08:00
patch.go Refactor error system () 2025-02-16 22:13:17 -08:00
pull.go Refactor error system () 2025-02-16 22:13:17 -08:00
pull_review.go Refactor error system () 2025-02-16 22:13:17 -08:00
release.go Refactor error system () 2025-02-16 22:13:17 -08:00
release_attachment.go Refactor error system () 2025-02-16 22:13:17 -08:00
release_tags.go Refactor error system () 2025-02-16 22:13:17 -08:00
repo.go Refactor error system () 2025-02-16 22:13:17 -08:00
repo_test.go Remove duplicate "ResponseWriter.Status" method () 2025-01-22 06:37:52 +00:00
star.go Refactor error system () 2025-02-16 22:13:17 -08:00
status.go Refactor error system () 2025-02-16 22:13:17 -08:00
subscriber.go Refactor error system () 2025-02-16 22:13:17 -08:00
tag.go Refactor error system () 2025-02-16 22:13:17 -08:00
teams.go Refactor error system () 2025-02-16 22:13:17 -08:00
topic.go Refactor error system () 2025-02-16 22:13:17 -08:00
transfer.go Refactor error system () 2025-02-16 22:13:17 -08:00
tree.go Refactor error system () 2025-02-16 22:13:17 -08:00
wiki.go Refactor error system () 2025-02-16 22:13:17 -08:00