Remove single unicode character from autotag query (#2363)

* Remove single unicode character from autotag query
* Compile regex once where possible
* Fix CPU profiling
* Only match unicode characters if in path
This commit is contained in:
WithoutPants
2022-03-07 13:26:24 +11:00
committed by GitHub
parent 0737ca953d
commit 18665863d6
3 changed files with 79 additions and 20 deletions

View File

@@ -21,7 +21,11 @@ WHERE performers_tags.tag_id = ?
GROUP BY performers_tags.performer_id
`
const singleFirstCharacterRegex = `^[\w\p{L}][.\-_ ]`
// KNOWN ISSUE: using \p{L} to find single unicode character names results in
// very slow queries.
// Suggested solution will be to cache single-character names and not include it
// in the autotag query.
const singleFirstCharacterRegex = `^[\w][.\-_ ]`
type performerQueryBuilder struct {
repository