Queries without indexes
This commit is contained in:
parent
b444617a00
commit
454fbc8ad7
|
@ -3103,8 +3103,9 @@ class Diaspora
|
||||||
// In fact it doesn't matter which user sends this - but it is needed by the protocol.
|
// In fact it doesn't matter which user sends this - but it is needed by the protocol.
|
||||||
// If the item belongs to a user, we take this user id.
|
// If the item belongs to a user, we take this user id.
|
||||||
if ($item['uid'] == 0) {
|
if ($item['uid'] == 0) {
|
||||||
$condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false];
|
$condition = ['verified' => true, 'blocked' => false,
|
||||||
$first_user = DBA::selectFirst('user', ['uid'], $condition);
|
'account_removed' => false, 'account_expired' => false, 'account-type' => User::ACCOUNT_TYPE_PERSON];
|
||||||
|
$first_user = DBA::selectFirst('user', ['uid'], $condition, ['order' => ['uid']]);
|
||||||
$owner = User::getOwnerDataById($first_user['uid']);
|
$owner = User::getOwnerDataById($first_user['uid']);
|
||||||
} else {
|
} else {
|
||||||
$owner = User::getOwnerDataById($item['uid']);
|
$owner = User::getOwnerDataById($item['uid']);
|
||||||
|
|
|
@ -52,7 +52,7 @@ class CleanItemUri
|
||||||
$ids = array_column($rows, 'id');
|
$ids = array_column($rows, 'id');
|
||||||
DBA::delete('item-uri', ['id' => $ids]);
|
DBA::delete('item-uri', ['id' => $ids]);
|
||||||
$affected_count += DBA::affectedRows();
|
$affected_count += DBA::affectedRows();
|
||||||
Logger::info('Updated', ['rows' => $affected_count]);
|
Logger::info('Deleted', ['rows' => $affected_count]);
|
||||||
}
|
}
|
||||||
DBA::close($uris);
|
DBA::close($uris);
|
||||||
Logger::notice('Orphaned URI-ID entries removed', ['rows' => $affected_count]);
|
Logger::notice('Orphaned URI-ID entries removed', ['rows' => $affected_count]);
|
||||||
|
|
|
@ -147,6 +147,7 @@ return [
|
||||||
"PRIMARY" => ["uid"],
|
"PRIMARY" => ["uid"],
|
||||||
"nickname" => ["nickname(32)"],
|
"nickname" => ["nickname(32)"],
|
||||||
"parent-uid" => ["parent-uid"],
|
"parent-uid" => ["parent-uid"],
|
||||||
|
"guid" => ["guid"],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"contact" => [
|
"contact" => [
|
||||||
|
@ -317,7 +318,8 @@ return [
|
||||||
"name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
|
"name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
|
||||||
],
|
],
|
||||||
"indexes" => [
|
"indexes" => [
|
||||||
"PRIMARY" => ["id"]
|
"PRIMARY" => ["id"],
|
||||||
|
"name" => ["name"]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
// Main tables
|
// Main tables
|
||||||
|
@ -375,6 +377,7 @@ return [
|
||||||
],
|
],
|
||||||
"indexes" => [
|
"indexes" => [
|
||||||
"PRIMARY" => ["id"],
|
"PRIMARY" => ["id"],
|
||||||
|
"installed_name" => ["installed", "name"],
|
||||||
"name" => ["UNIQUE", "name"],
|
"name" => ["UNIQUE", "name"],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
@ -480,6 +483,7 @@ return [
|
||||||
],
|
],
|
||||||
"indexes" => [
|
"indexes" => [
|
||||||
"PRIMARY" => ["id"],
|
"PRIMARY" => ["id"],
|
||||||
|
"expire" => ["expire"],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"config" => [
|
"config" => [
|
||||||
|
@ -693,6 +697,7 @@ return [
|
||||||
],
|
],
|
||||||
"indexes" => [
|
"indexes" => [
|
||||||
"PRIMARY" => ["id"],
|
"PRIMARY" => ["id"],
|
||||||
|
"priority" => ["priority"],
|
||||||
"hook_file_function" => ["UNIQUE", "hook", "file", "function"],
|
"hook_file_function" => ["UNIQUE", "hook", "file", "function"],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
@ -1382,7 +1387,8 @@ return [
|
||||||
],
|
],
|
||||||
"indexes" => [
|
"indexes" => [
|
||||||
"PRIMARY" => ["id"],
|
"PRIMARY" => ["id"],
|
||||||
"uid" => ["uid"],
|
"uid_term" => ["uid", "term(64)"],
|
||||||
|
"term" => ["term(64)"]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"session" => [
|
"session" => [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user