forked from friendica/friendica
Two slow database queries fixed
This commit is contained in:
parent
7ea03b0e22
commit
60823c07fe
5 changed files with 8 additions and 3 deletions
|
|
@ -236,6 +236,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
|||
INDEX `next-update` (`next-update`),
|
||||
INDEX `local-data-next-update` (`local-data`,`next-update`),
|
||||
INDEX `uid_lastitem` (`uid`,`last-item`),
|
||||
INDEX `uid_created` (`uid`,`created`),
|
||||
INDEX `baseurl` (`baseurl`(64)),
|
||||
INDEX `uid_contact-type` (`uid`,`contact-type`),
|
||||
INDEX `uid_self_contact-type` (`uid`,`self`,`contact-type`),
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ contact table
|
|||
| next-update | next-update |
|
||||
| local-data-next-update | local-data, next-update |
|
||||
| uid_lastitem | uid, last-item |
|
||||
| uid_created | uid, created |
|
||||
| baseurl | baseurl(64) |
|
||||
| uid_contact-type | uid, contact-type |
|
||||
| uid_self_contact-type | uid, self, contact-type |
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ class Item
|
|||
Post\DeliveryData::delete($item['uri-id']);
|
||||
|
||||
// If it's the parent of a comment thread, kill all the kids
|
||||
if ($item['gravity'] == self::GRAVITY_PARENT) {
|
||||
if ($item['gravity'] == self::GRAVITY_PARENT && !is_null($item['parent'])) {
|
||||
self::markForDeletion(['parent' => $item['parent'], 'deleted' => false], $priority);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@ class Directory extends BaseApi
|
|||
$condition = ['uid' => 0, 'hidden' => false, 'network' => Protocol::FEDERATED];
|
||||
}
|
||||
|
||||
$params = ['limit' => [$request['offset'], $request['limit']],
|
||||
'order' => [($request['order'] == 'active') ? 'last-item' : 'created' => true]];
|
||||
$params = [
|
||||
'limit' => [$request['offset'], $request['limit']],
|
||||
'order' => [($request['order'] == 'active') ? 'last-item' : 'created' => true]
|
||||
];
|
||||
|
||||
$accounts = [];
|
||||
$contacts = DBA::select($table, ['id', 'uid'], $condition, $params);
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ return [
|
|||
"next-update" => ["next-update"],
|
||||
"local-data-next-update" => ["local-data", "next-update"],
|
||||
"uid_lastitem" => ["uid", "last-item"],
|
||||
"uid_created" => ["uid", "created"],
|
||||
"baseurl" => ["baseurl(64)"],
|
||||
"uid_contact-type" => ["uid", "contact-type"],
|
||||
"uid_self_contact-type" => ["uid", "self", "contact-type"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue