]> git.mxchange.org Git - friendica.git/commit
Faster count queries when updating the info about current node
authorEsko Arajärvi <esko.arajarvi@solita.fi>
Tue, 4 Feb 2025 16:46:06 +0000 (18:46 +0200)
committerEsko Arajärvi <esko.arajarvi@solita.fi>
Tue, 4 Feb 2025 17:47:31 +0000 (19:47 +0200)
commit25bb9b12c14175abc87221a951bcf54d81fdef3f
tree68f4808cd8e21d129f56bb072970fc8d3cd91924
parentedbf86449d5b04bd5b1ec62d70f30f2afbdb8839
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
database.sql
doc/database/db_post-user.md
static/dbstructure.config.php