summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-07-14 15:35:46 +0300
committerAndrew Dolgov <[email protected]>2015-07-14 15:35:46 +0300
commit8aaf7f4b7b5f808b908465711d92e155ff96d789 (patch)
tree1066e8cc9c5e554dd04af6bb22c665c482491333 /include
parente7a66d123097502156d87b4ebbbd63ac57d57d87 (diff)
parentc2916856541ed82b2f11b5f3ff29b1e4f5cd6b3e (diff)
Merge pull request #468 from GregThib/patch-1
Performance breakthrough
Diffstat (limited to 'include')
-rw-r--r--include/functions.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php
index 22179e1a4..a57c09478 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -320,8 +320,7 @@
// purge orphaned posts in main content table
$result = db_query("DELETE FROM ttrss_entries WHERE
- (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
-
+ id NOT IN (SELECT ref_id FROM ttrss_user_entries WHERE ref_id IS NOT NULL)");
if ($do_output) {
$rows = db_affected_rows($result);
_debug("Purged $rows orphaned posts.");