Improve SQL-Queries / fixed "fetch_parents" setting

This commit is contained in:
Michael 2022-08-08 20:00:21 +00:00
parent bbbbf8fd6b
commit 548b7f43a5
4 changed files with 8 additions and 8 deletions

View file

@ -55,11 +55,11 @@ class UpdateContacts
$ids = self::getContactsToUpdate($condition, $limit, []);
Logger::info('Fetched federated user contacts', ['count' => count($ids)]);
$conditions = ["`id` IN (SELECT `author-id` FROM `post` WHERE `author-id` = `contact`.`id`)",
"`id` IN (SELECT `owner-id` FROM `post` WHERE `owner-id` = `contact`.`id`)",
"`id` IN (SELECT `causer-id` FROM `post` WHERE `causer-id` = `contact`.`id`)",
"`id` IN (SELECT `cid` FROM `post-tag` WHERE `cid` = `contact`.`id`)",
"`id` IN (SELECT `cid` FROM `user-contact` WHERE `cid` = `contact`.`id`)"];
$conditions = ["`id` IN (SELECT `author-id` FROM `post`)",
"`id` IN (SELECT `owner-id` FROM `post`)",
"`id` IN (SELECT `causer-id` FROM `post` WHERE NOT `causer-id` IS NULL)",
"`id` IN (SELECT `cid` FROM `post-tag`)",
"`id` IN (SELECT `cid` FROM `user-contact`)"];
foreach ($conditions as $contact_condition) {
$condition = DBA::mergeConditions($base_condition,