forked-synapse/synapse/storage
Erik Johnston b11f7b5122
Improve DB performance of calculating badge counts for push. (#16756)
The crux of the change is to try and make the queries simpler and pull
out fewer rows. Before, there were quite a few joins against subqueries,
which caused postgres to pull out more rows than necessary.

Instead, let's simplify the query and do some of the filtering out in
Python instead, letting Postgres do better optimizations now that it
doesn't have to deal with joins against subqueries.

Review note: this is a complete rewrite of the function, so not sure how
useful the diff is.

---------

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2024-01-11 11:52:13 +00:00
..
controllers Update license headers 2023-11-21 15:29:58 -05:00
databases Improve DB performance of calculating badge counts for push. (#16756) 2024-01-11 11:52:13 +00:00
engines Update license headers 2023-11-21 15:29:58 -05:00
schema Update book location 2023-12-13 16:15:22 +00:00
util Update license headers 2023-11-21 15:29:58 -05:00
__init__.py Update license headers 2023-11-21 15:29:58 -05:00
_base.py Update license headers 2023-11-21 15:29:58 -05:00
background_updates.py Update license headers 2023-11-21 15:29:58 -05:00
database.py Update license headers 2023-11-21 15:29:58 -05:00
keys.py Update license headers 2023-11-21 15:29:58 -05:00
prepare_database.py Update license headers 2023-11-21 15:29:58 -05:00
push_rule.py Update license headers 2023-11-21 15:29:58 -05:00
roommember.py Update license headers 2023-11-21 15:29:58 -05:00
types.py Update license headers 2023-11-21 15:29:58 -05:00