Performance problem about pin issue #13961

Closed
opened 2025-11-02 10:58:28 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @lunny on GitHub (Jan 11, 2025).

This SQL is slow because pin_order is not an index column. After reviewing #24406 again, I prefer to create a new table to store pin order like https://github.com/go-gitea/gitea/pull/24406#issuecomment-1527747296 described by @delvh

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 = xxx) AND (is_pull = 0) AND (pin_order > 0) ORDER BY pin_order

Another idea is to add an index for column pin_order but we will have more and more index columns which is still a problem.

Originally created by @lunny on GitHub (Jan 11, 2025). This SQL is slow because `pin_order` is not an index column. After reviewing #24406 again, I prefer to create a new table to store pin order like https://github.com/go-gitea/gitea/pull/24406#issuecomment-1527747296 described by @delvh ```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 = xxx) AND (is_pull = 0) AND (pin_order > 0) ORDER BY pin_order ``` Another idea is to add an index for column `pin_order` but we will have more and more index columns which is still a problem.
GiteaMirror added the performance/bigrepo label 2025-11-02 10:58:28 -06:00
Author
Owner

@lunny commented on GitHub (Oct 15, 2025):

Resolved by #33452

@lunny commented on GitHub (Oct 15, 2025): Resolved by #33452
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13961