From cf98e4bf43c1007cce5ce19574f0c903ba5a206a Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 7 Jul 2019 17:13:56 +0100 Subject: [PATCH] remove one-positive-tag special case which is slower than the generic build_accurate_search_querylet --- core/imageboard/image.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/core/imageboard/image.php b/core/imageboard/image.php index b8dee8ff..67f6ec8f 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -888,23 +888,6 @@ class Image "); } - // one positive tag (a common case), do an optimised search - elseif ($positive_tag_count === 1 && $negative_tag_count === 0) { - # "LIKE" to account for wildcards - $query = new Querylet($database->scoreql_to_sql(" - SELECT * - FROM ( - SELECT images.* - FROM images - JOIN image_tags ON images.id=image_tags.image_id - JOIN tags ON image_tags.tag_id=tags.id - WHERE SCORE_STRNORM(tag) LIKE SCORE_STRNORM(:tag) - GROUP BY images.id - ) AS images - WHERE 1=1 - "), ["tag"=>Tag::sqlify($tag_conditions[0]->tag)]); - } - // more than one positive tag, or more than zero negative tags else { $query = Image::build_accurate_search_querylet($tag_conditions);