mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix exclude filter query performance (#1815)
* Fix query performance * Reorder changelog changes by size to prepare for release
This commit is contained in:
committed by
GitHub
parent
04ca11e62e
commit
c31c7c3c99
@@ -211,7 +211,7 @@ func getMultiCriterionClause(primaryTable, foreignTable, joinTable, primaryFK, f
|
||||
} else if criterion.Modifier == models.CriterionModifierExcludes {
|
||||
// excludes all of the provided ids
|
||||
if joinTable != "" {
|
||||
whereClause = "not exists (select " + joinTable + "." + primaryFK + " from " + joinTable + " where " + joinTable + "." + primaryFK + " = " + primaryTable + ".id and " + joinTable + "." + foreignFK + " in " + getInBinding(len(criterion.Value)) + ")"
|
||||
whereClause = primaryTable + ".id not in (select " + joinTable + "." + primaryFK + " from " + joinTable + " where " + joinTable + "." + foreignFK + " in " + getInBinding(len(criterion.Value)) + ")"
|
||||
} else {
|
||||
whereClause = "not exists (select s.id from " + primaryTable + " as s where s.id = " + primaryTable + ".id and s." + foreignFK + " in " + getInBinding(len(criterion.Value)) + ")"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user