-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
type/bugtype/upstreamThis is an issue in one of Gitea's dependencies and should be reported thereThis is an issue in one of Gitea's dependencies and should be reported there
Milestone
Description
Description
Our current DELETE query for actions is rather inefficient on MariaDB:
DELETE FROM action WHERE comment_id IN (SELECT id FROM comment WHERE issue_id=?)
gitea/models/activities/action.go
Lines 688 to 702 in ab388de
func DeleteIssueActions(ctx context.Context, repoID, issueID int64) error { | |
// delete actions assigned to this issue | |
subQuery := builder.Select("`id`"). | |
From("`comment`"). | |
Where(builder.Eq{"`issue_id`": issueID}) | |
if _, err := db.GetEngine(ctx).In("comment_id", subQuery).Delete(&Action{}); err != nil { | |
return err | |
} | |
_, err := db.GetEngine(ctx).Table("action").Where("repo_id = ?", repoID). | |
In("op_type", ActionCreateIssue, ActionCreatePullRequest). | |
Where("content LIKE ?", strconv.FormatInt(issueID, 10)+"|%"). | |
Delete(&Action{}) | |
return err | |
} |
Caused by https://jira.mariadb.org/browse/MDEV-16289
see https://codeberg.org/forgejo/forgejo/issues/1161 and https://codeberg.org/forgejo/forgejo/pulls/1165
Gitea Version
1.20.2
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?
Binary started via systemd behind a caddy reverse proxy.
Database
None
Metadata
Metadata
Assignees
Labels
type/bugtype/upstreamThis is an issue in one of Gitea's dependencies and should be reported thereThis is an issue in one of Gitea's dependencies and should be reported there