forked-synapse/synapse
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
..
_scripts Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
api Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
app Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
appservice Update license headers 2023-11-21 15:29:58 -05:00
config Correctly handle OIDC config with no client_secret set (#16806) 2024-01-10 17:16:49 +00:00
crypto Update license headers 2023-11-21 15:29:58 -05:00
events Port EventInternalMetadata class to Rust (#16782) 2024-01-08 14:06:48 +00:00
federation Filter out rooms from the room directory being served to other homeservers when those rooms block that homeserver by their Access Control Lists. (#16759) 2024-01-08 17:24:20 +00:00
handlers Faster load recents for sync (#16783) 2024-01-10 15:11:59 +00:00
http Fix email verification redirection (#16761) 2024-01-02 16:25:26 +00:00
logging Update license headers 2023-11-21 15:29:58 -05:00
media Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
metrics Update license headers 2023-11-21 15:29:58 -05:00
module_api Update book location 2023-12-13 16:15:22 +00:00
push Improve DB performance of calculating badge counts for push. (#16756) 2024-01-11 11:52:13 +00:00
replication Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
res Use oEmbed for YouTube Shorts (#15025) 2023-05-03 12:54:42 -04:00
rest Search non ASCII display names using Admin API (#16767) 2024-01-04 09:36:57 +00:00
server_notices Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
spam_checker_api Update license headers 2023-11-21 15:29:58 -05:00
state Update license headers 2023-11-21 15:29:58 -05:00
static Update link to the clients webpage, fix #15825 (#15874) 2023-07-06 17:28:09 +02:00
storage Improve DB performance of calculating badge counts for push. (#16756) 2024-01-11 11:52:13 +00:00
streams Update license headers 2023-11-21 15:29:58 -05:00
synapse_rust Port EventInternalMetadata class to Rust (#16782) 2024-01-08 14:06:48 +00:00
types Reduce amount of state pulled out when querying federation hierachy (#16785) 2024-01-10 14:31:35 +00:00
util Update license headers 2023-11-21 15:29:58 -05:00
__init__.py Revert changes to README 2023-12-13 15:02:08 +00:00
_pydantic_compat.py Update license headers 2023-11-21 15:29:58 -05:00
event_auth.py Update license headers 2023-11-21 15:29:58 -05:00
notifier.py Update license headers 2023-11-21 15:29:58 -05:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Update license headers 2023-11-21 15:29:58 -05:00
visibility.py Update license headers 2023-11-21 15:29:58 -05:00