95b1079e36
- The action tables can become very large as it's a dumpster for every action that an user does on an repository. - The following query: `DELETE FROM action WHERE comment_id IN (SELECT id FROM comment WHERE issue_id=?)` is not using indexes for `comment_id` and is instead using an full table scan by MariaDB. - Rewriting the query to use an JOIN will allow MariaDB to use the index. - More information: https://codeberg.org/Codeberg-Infrastructure/techstack-support/issues/9 (cherry picked from commit6646fcf31f
) Conflicts: tests/integration/api_nodeinfo_test.go https://codeberg.org/forgejo/forgejo/pulls/1178 (cherry picked from commit6465b74632
)
77 lines
1.4 KiB
YAML
77 lines
1.4 KiB
YAML
-
|
|
id: 1
|
|
type: 7 # label
|
|
poster_id: 2
|
|
issue_id: 1 # in repo_id 1
|
|
label_id: 1
|
|
content: "1"
|
|
created_unix: 946684810
|
|
-
|
|
id: 2
|
|
type: 0 # comment
|
|
poster_id: 3 # user not watching (see watch.yml)
|
|
issue_id: 1 # in repo_id 1
|
|
content: "good work!"
|
|
created_unix: 946684811
|
|
updated_unix: 946684811
|
|
-
|
|
id: 3
|
|
type: 0 # comment
|
|
poster_id: 5 # user not watching (see watch.yml)
|
|
issue_id: 1 # in repo_id 1
|
|
content: "meh..."
|
|
created_unix: 946684812
|
|
updated_unix: 946684812
|
|
-
|
|
id: 4
|
|
type: 21 # code comment
|
|
poster_id: 1
|
|
issue_id: 2
|
|
content: "meh..."
|
|
review_id: 4
|
|
line: 4
|
|
tree_path: "README.md"
|
|
created_unix: 946684812
|
|
invalidated: false
|
|
-
|
|
id: 5
|
|
type: 21 # code comment
|
|
poster_id: 1
|
|
issue_id: 2
|
|
content: "meh..."
|
|
line: -4
|
|
tree_path: "README.md"
|
|
created_unix: 946684812
|
|
invalidated: false
|
|
|
|
-
|
|
id: 6
|
|
type: 21 # code comment
|
|
poster_id: 1
|
|
issue_id: 2
|
|
content: "it's already invalidated. boring..."
|
|
line: -4
|
|
tree_path: "README.md"
|
|
created_unix: 946684812
|
|
invalidated: true
|
|
|
|
-
|
|
id: 7
|
|
type: 21 # code comment
|
|
poster_id: 100
|
|
issue_id: 3
|
|
content: "a review from a deleted user"
|
|
line: -4
|
|
review_id: 10
|
|
tree_path: "README.md"
|
|
created_unix: 946684812
|
|
invalidated: true
|
|
|
|
-
|
|
id: 8
|
|
type: 0 # comment
|
|
poster_id: 15
|
|
issue_id: 17 # in repo_id 32
|
|
content: "meh..."
|
|
created_unix: 946684812
|
|
updated_unix: 946684812
|