if the search is for one tag, then 'count(tag)' (expensive function) = 'tag.count' (index lookup)
This commit is contained in:
parent
e96e350ccb
commit
3b2941a5bc
1 changed files with 5 additions and 0 deletions
|
@ -140,6 +140,11 @@ class Image {
|
|||
}
|
||||
return $total;
|
||||
}
|
||||
else if(count($tags) == 1) {
|
||||
return $database->db->GetOne(
|
||||
$database->engine->scoreql_to_sql("SELECT count FROM tags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(?)"),
|
||||
$tags);
|
||||
}
|
||||
else {
|
||||
$querylet = Image::build_search_querylet($tags);
|
||||
$result = $database->execute($querylet->sql, $querylet->variables);
|
||||
|
|
Reference in a new issue