summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-10-09 16:58:31 +0400
committerAndrew Dolgov <[email protected]>2013-10-09 16:58:31 +0400
commitb66be03a4865b50efeddfce00cc45b7b7c9692ef (patch)
treec7c409f1a2fb861a6c04bb3717a05cb34d726009 /include
parente198cca75bc5f6bc573174739780e18b4c6a7daa (diff)
add experimental hack to speed up ccache category calculation
Diffstat (limited to 'include')
-rw-r--r--include/ccache.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/ccache.php b/include/ccache.php
index d89b9efe0..406dec81d 100644
--- a/include/ccache.php
+++ b/include/ccache.php
@@ -92,7 +92,7 @@
}
function ccache_update($feed_id, $owner_uid, $is_cat = false,
- $update_pcat = true) {
+ $update_pcat = true, $pcat_fast = false) {
if (!is_numeric($feed_id)) return;
@@ -127,11 +127,13 @@
/* Recalculate counters for child feeds */
- $result = db_query("SELECT id FROM ttrss_feeds
+ if (!$pcat_fast) {
+ $result = db_query("SELECT id FROM ttrss_feeds
WHERE owner_uid = '$owner_uid' AND $cat_qpart");
- while ($line = db_fetch_assoc($result)) {
- ccache_update($line["id"], $owner_uid, false, false);
+ while ($line = db_fetch_assoc($result)) {
+ ccache_update($line["id"], $owner_uid, false, false);
+ }
}
$result = db_query("SELECT SUM(value) AS sv
@@ -177,7 +179,7 @@
$cat_id = (int) db_fetch_result($result, 0, "cat_id");
- ccache_update($cat_id, $owner_uid, true);
+ ccache_update($cat_id, $owner_uid, true, true, true);
}
}