[tag_list] ln(x) is 10x faster than log(2.7, x)
This commit is contained in:
parent
6020c15e30
commit
b60646e98d
1 changed files with 2 additions and 3 deletions
|
@ -251,16 +251,15 @@ class TagList extends Extension
|
||||||
return file_get_contents($cache_key);
|
return file_get_contents($cache_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SHIT: PDO/pgsql has problems using the same named param twice -_-;;
|
|
||||||
$tag_data = $database->get_all("
|
$tag_data = $database->get_all("
|
||||||
SELECT
|
SELECT
|
||||||
tag,
|
tag,
|
||||||
FLOOR(LOG(2.7, LOG(2.7, count - :tags_min2 + 1)+1)*1.5*100)/100 AS scaled
|
FLOOR(LN(LN(count - :tags_min + 1)+1)*1.5*100)/100 AS scaled
|
||||||
FROM tags
|
FROM tags
|
||||||
WHERE count >= :tags_min
|
WHERE count >= :tags_min
|
||||||
AND LOWER(tag) LIKE LOWER(:starts_with)
|
AND LOWER(tag) LIKE LOWER(:starts_with)
|
||||||
ORDER BY LOWER(tag)
|
ORDER BY LOWER(tag)
|
||||||
", ["tags_min" => $tags_min, "tags_min2" => $tags_min, "starts_with" => $starts_with]);
|
", ["tags_min" => $tags_min, "starts_with" => $starts_with]);
|
||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
if ($config->get_bool(TagListConfig::PAGES)) {
|
if ($config->get_bool(TagListConfig::PAGES)) {
|
||||||
|
|
Reference in a new issue