From ba36a7587afdd5a597631c3430b1995dd4c65e5d Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 25 Oct 2015 10:30:40 +0100 Subject: DB::Discussions: Minor improvement to post <-> board filter query I don't know why I didn't apply this one before, I did make this change when benchmarking the fulltext search queries and with the introduction of the bb_tsvector() function this change pretty much always improves performance. --- lib/VNDB/DB/Discussions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/VNDB') diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm index 79cf7b39..bacc728e 100644 --- a/lib/VNDB/DB/Discussions.pm +++ b/lib/VNDB/DB/Discussions.pm @@ -193,7 +193,7 @@ sub dbPostGet { $o{search} ? ( 'bb_tsvector(msg) @@ to_tsquery(?)' => $o{search}) : (), $o{type} ? ( - 'tp.tid = ANY(ARRAY(SELECT tid FROM threads_boards WHERE type IN(!l)))' => [ ref $o{type} ? $o{type} : [ $o{type} ] ] ) : (), + 'tp.tid IN(SELECT tid FROM threads_boards WHERE type IN(!l))' => [ ref $o{type} ? $o{type} : [ $o{type} ] ] ) : (), ); my @select = ( -- cgit v1.2.3