aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-04-25 01:00:39 +0000
committerrvelices <rv-github@modusoptimus.com>2008-04-25 01:00:39 +0000
commit94aa1b52822c599229db9933c4d5678484afe467 (patch)
tree8282faeb5e9635c54d212f4d5613d2c462d1bced /include/functions_tag.inc.php
parent23fcaf6b6493c8d479a30201ea9fff3e5cffe4ff (diff)
- minor sql query optimizations
git-svn-id: http://piwigo.org/svn/trunk@2308 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index fff7cdf90..7bd5d8408 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -49,7 +49,8 @@ SELECT tag_id, COUNT(DISTINCT(it.image_id)) counter
'
WHERE'
).'
- GROUP BY tag_id';
+ GROUP BY tag_id
+ ORDER BY NULL';
$tag_counters = simple_hash_from_query($query, 'tag_id', 'counter');
if ( empty($tag_counters) )
@@ -243,6 +244,11 @@ SELECT id, name, url_name, count(*) counter
ORDER BY counter DESC
LIMIT 0,'.$max_tags;
}
+ else
+ {
+ $query .= '
+ ORDER BY NULL';
+ }
$result = pwg_query($query);
$tags = array();