Slow SQL Query on CheckRepoStats #12667

Open
opened 2025-11-02 10:17:40 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @lunny on GitHub (Mar 18, 2024).

Description

models/repo.go:215:CheckRepoStats() [W] [Slow SQL Query] SELECT repo.id FROM `repository` repo WHERE repo.num_watches!=(SELECT COUNT(*) FROM `watch` WHERE repo_id=repo.id AND mode<>2) [] - 6m40.204114759s

models/repo.go:215:CheckRepoStats() [W] [Slow SQL Query] SELECT label.id FROM `label` WHERE label.num_issues!=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=label.id) [] - 6m31.342495533s

Gitea Version

main

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

production server

Database

None

Originally created by @lunny on GitHub (Mar 18, 2024). ### Description ```log models/repo.go:215:CheckRepoStats() [W] [Slow SQL Query] SELECT repo.id FROM `repository` repo WHERE repo.num_watches!=(SELECT COUNT(*) FROM `watch` WHERE repo_id=repo.id AND mode<>2) [] - 6m40.204114759s models/repo.go:215:CheckRepoStats() [W] [Slow SQL Query] SELECT label.id FROM `label` WHERE label.num_issues!=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=label.id) [] - 6m31.342495533s ``` ### Gitea Version main ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? production server ### Database None
GiteaMirror added the performance/speed label 2025-11-02 10:17:40 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12667