Merge pull request #468 from GregThib/patch-1

Performance breakthrough
This commit is contained in:
Andrew Dolgov 2015-07-14 15:35:46 +03:00
commit 8aaf7f4b7b
1 changed files with 1 additions and 2 deletions

View File

@ -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.");