mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 22:45:56 +00:00
Performance breakthrough
Improvement in the Purge method for huge performance increase. "WHERE ref_id IS NOT NULL" is needed by pgsql, not necessarily by mysql. This is a more standard way to make deletions based on propagation (from ttrss_user_entries) with 1-to-N relations.
This commit is contained in:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user