summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-07-15 13:29:03 +0300
committerAndrew Dolgov <[email protected]>2015-07-15 13:29:03 +0300
commit7680d44ef21d3a8eec3e564516b348e0feb87e28 (patch)
tree0b95d3ce28f52d3e142b2679901d0d3d0fd3366e /include
parent9264ec7055de0ccf5f592af04519feb46db5c6b1 (diff)
purge_orphans: optimize the query, maybe
https://tt-rss.org/forum/viewtopic.php?f=1&t=3417&p=20408#p20407
Diffstat (limited to 'include')
-rw-r--r--include/functions.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php
index 22179e1a4..e5f2ca486 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -320,7 +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");
+ NOT EXISTS (SELECT ref_id FROM ttrss_user_entries WHERE ref_id = id)");
if ($do_output) {
$rows = db_affected_rows($result);