summaryrefslogtreecommitdiff
path: root/lib/VNWeb
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-12-23 10:23:43 +0100
committerYorhel <git@yorhel.nl>2020-12-23 10:23:46 +0100
commit404463368b57ba5f1b3e2abce76b724e45696461 (patch)
treede90cf74e4b2e704a5f2c2289f5666068c9e4429 /lib/VNWeb
parent5da40cc1dc01170251c9065beea141ac3b7696ff (diff)
AdvSearch: Uncomment awesome staff search performance optimization
Not sure why I commented that out, prolly for testing. It fixes a few timeouts I've observed.
Diffstat (limited to 'lib/VNWeb')
-rw-r--r--lib/VNWeb/AdvSearch.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNWeb/AdvSearch.pm b/lib/VNWeb/AdvSearch.pm
index 3b372c42..239d35f8 100644
--- a/lib/VNWeb/AdvSearch.pm
+++ b/lib/VNWeb/AdvSearch.pm
@@ -410,7 +410,7 @@ f s => 5 => 'role', { enum => [ 'seiyuu', keys %CREDIT_TYPE ] },
my @grp = $all && @$val > 1 ? ('GROUP BY vs.aid HAVING COUNT(vs.role) =', \scalar @$val) : ();
if($#TYPE && $TYPE[$#TYPE-1] eq 'v') {
return sql $neg ? 'NOT' : '', 'EXISTS(SELECT 1 FROM vn_seiyuu vs WHERE vs.id = v.id AND vs.aid = sa.aid)' if $val->[0] eq 'seiyuu';
- #return sql 'vs.role IN', $val if !@grp && !$neg; # Shortcut referencing the vn_staff table we're already querying
+ return sql 'vs.role IN', $val if !@grp && !$neg; # Shortcut referencing the vn_staff table we're already querying
sql 'sa.aid', $neg ? 'NOT' : '', 'IN(SELECT vs.aid FROM vn_staff vs WHERE vs.id = v.id AND vs.role IN', $val, @grp, ')';
} else {
return sql $neg ? 'NOT' : '', 'EXISTS(SELECT 1 FROM vn_seiyuu vs JOIN vn v ON v.id = vs.id WHERE NOT v.hidden AND vs.aid = sa.aid)' if $val->[0] eq 'seiyuu';