summaryrefslogtreecommitdiff
path: root/actions/publictagcloud.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-04 11:06:01 -0800
committerBrion Vibber <brion@pobox.com>2010-02-04 11:06:01 -0800
commit5a1cbdc6f1e32be7b8430924a1125422d8457584 (patch)
tree28147de9aef4dd9fcec909e2ca0a13cc7d204cff /actions/publictagcloud.php
parent7a7e2162dd7eed59e60d9360d8692abc111d940c (diff)
Add time-based cutoffs for public tag cloud, favorited lists to speed up those queries.
Defaulting to only looking at last 90 days of activity, can be adjusted up or down. $config['tag']['cutoff'] = 86400 * 90; $config['popular']['cutoff'] = 86400 * 90; Per-user and per-group tag clouds do not use the cutoff (and it doesn't help with indexing on them).
Diffstat (limited to 'actions/publictagcloud.php')
-rw-r--r--actions/publictagcloud.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php
index 9e4478dbb..9993b2d3f 100644
--- a/actions/publictagcloud.php
+++ b/actions/publictagcloud.php
@@ -106,7 +106,10 @@ class PublictagcloudAction extends Action
#Add the aggregated columns...
$tags->selectAdd('max(notice_id) as last_notice_id');
$calc = common_sql_weight('created', common_config('tag', 'dropoff'));
+ $cutoff = sprintf("notice_tag.created > '%s'",
+ common_sql_date(time() - common_config('tag', 'cutoff')));
$tags->selectAdd($calc . ' as weight');
+ $tags->addWhere($cutoff);
$tags->groupBy('tag');
$tags->orderBy('weight DESC');