mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 11:54:31 +02:00
Faster count queries when updating the info about current node
MySQL optimiser seems to prefer a full table scan of `post-user` table in the count query mentioned in issue #14763. When the origin and deleted columns are added to the index, the IN-query part of the query can be done with index-only scan, which is much faster. Adding the columns in the order uri-id, origin, deleted allows some other queries to also use it when checking for uri-id and origin. Fixes #14763
This commit is contained in:
parent
edbf86449d
commit
25bb9b12c1
3 changed files with 29 additions and 29 deletions
|
@ -44,7 +44,7 @@ use Friendica\Database\DBA;
|
|||
|
||||
// This file is required several times during the test in DbaDefinition which justifies this condition
|
||||
if (!defined('DB_UPDATE_VERSION')) {
|
||||
define('DB_UPDATE_VERSION', 1576);
|
||||
define('DB_UPDATE_VERSION', 1577);
|
||||
}
|
||||
|
||||
return [
|
||||
|
@ -1604,7 +1604,7 @@ return [
|
|||
"indexes" => [
|
||||
"PRIMARY" => ["id"],
|
||||
"uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
|
||||
"uri-id" => ["uri-id"],
|
||||
"uri-id_origin_deleted" => ["uri-id", "origin", "deleted"],
|
||||
"parent-uri-id" => ["parent-uri-id"],
|
||||
"thr-parent-id" => ["thr-parent-id"],
|
||||
"external-id" => ["external-id"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue