MatrixSynapse/synapse/storage/databases/main
pacien 07d7cbfe69
devices: use combined ANY clause for faster cleanup (#15861)
Old device entries for the same user were being removed in individual
SQL commands, making the batch take way longer than necessary.

This combines the commands into a single one with a IN/ANY clause.

Example of log entry before the change, regularly observed with
"log_min_duration_statement = 10000" in PostgreSQL's config:

    LOG:  duration: 42538.282 ms  statement:
    DELETE FROM device_lists_stream
    WHERE user_id = '@someone' AND device_id = 'someid1'
    AND stream_id < 123456789
    ;
    DELETE FROM device_lists_stream
    WHERE user_id = '@someone' AND device_id = 'someid2'
    AND stream_id < 123456789
    ;
    [repeated for each device ID of that user, potentially a lot...]

With the patch applied on my instance for the past couple of days, I
no longer notice overly long statements of that particular kind.

Signed-off-by: pacien <pacien.trangirard@pacien.net>
2023-07-03 16:39:38 +02:00
..
__init__.py Remove experimental MSC2716 implementation to incrementally import history into existing rooms (#15748) 2023-06-16 14:12:24 -05:00
account_data.py Update code to refer to "workers". (#15606) 2023-05-16 15:56:38 -04:00
appservice.py Return read-only collections from `@cached` methods (#13755) 2023-02-10 23:29:00 +00:00
cache.py Fix forgotten rooms missing in initial sync (#15815) 2023-06-21 14:56:31 +01:00
censor_events.py Safe async event cache (#13308) 2022-07-19 11:25:29 +00:00
client_ips.py
deviceinbox.py to_device updates could be dropped when consuming the replication stream (#15349) 2023-03-30 19:41:14 +02:00
devices.py devices: use combined ANY clause for faster cleanup (#15861) 2023-07-03 16:39:38 +02:00
directory.py Load `/directory/room/{roomAlias}` endpoint on workers (#15333) 2023-04-14 10:24:06 +01:00
e2e_room_keys.py Delete server-side backup keys when deactivating an account. (#15181) 2023-04-04 20:16:08 +00:00
end_to_end_keys.py Cache requests for user's devices from federation (#15675) 2023-06-01 13:25:20 +00:00
event_federation.py Remove experimental MSC2716 implementation to incrementally import history into existing rooms (#15748) 2023-06-16 14:12:24 -05:00
event_push_actions.py Set thread_id column to non-null for event_push_{actions,actions_staging,summary} (#15597) 2023-05-26 13:16:08 -04:00
events.py Remove experimental MSC2716 implementation to incrementally import history into existing rooms (#15748) 2023-06-16 14:12:24 -05:00
events_bg_updates.py Remove support for aggregating reactions (#15172) 2023-02-28 18:49:28 +00:00
events_forward_extremities.py
events_worker.py Prefill events after invalidate not before when persisting events (#15758) 2023-06-14 09:42:18 +01:00
experimental_features.py Add an admin API endpoint to support per-user feature flags (#15344) 2023-04-28 11:33:45 -07:00
filtering.py `N + 3`: Read from column `full_user_id` rather than `user_id` of tables `profiles` and `user_filters` (#15649) 2023-06-02 17:24:13 -07:00
keys.py Modify StoreKeyFetcher to read from server_keys_json. (#15417) 2023-04-20 12:30:32 -04:00
lock.py Require SQLite >= 3.27.0 (#13760) 2022-09-09 11:14:10 +01:00
media_repository.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
metrics.py Remove old R30 because R30v2 supercedes it (#10428) 2023-05-19 11:13:44 -05:00
monthly_active_users.py Return read-only collections from `@cached` methods (#13755) 2023-02-10 23:29:00 +00:00
openid.py
presence.py Always notify replication when a stream advances (#14877) 2023-01-20 18:02:18 +00:00
profile.py `N + 3`: Read from column `full_user_id` rather than `user_id` of tables `profiles` and `user_filters` (#15649) 2023-06-02 17:24:13 -07:00
purge_events.py Clear event caches when we purge history (#15609) 2023-06-08 13:14:40 +01:00
push_rule.py Stabilize support for MSC3952: Intentional mentions. (#15520) 2023-06-06 09:11:07 +01:00
pusher.py Fix the 'set_device_id_for_pushers_txn' background update. (#15391) 2023-04-05 07:49:15 -04:00
receipts.py Update code to refer to "workers". (#15606) 2023-05-16 15:56:38 -04:00
registration.py Add column `full_user_id` to tables `profiles` and `user_filters`. (#15458) 2023-04-26 16:03:26 -07:00
rejections.py
relations.py Add a catch-all * to the supported relation types when redacting (#15705) 2023-06-02 13:13:50 +00:00
room.py Factor out an `is_mine_server_name` method (#15542) 2023-05-05 15:06:22 +01:00
roommember.py Remove superfluous `room_memberships` join from background update (#15733) 2023-06-07 11:47:01 -05:00
search.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
session.py
signatures.py Return read-only collections from `@cached` methods (#13755) 2023-02-10 23:29:00 +00:00
state.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
state_deltas.py
stats.py Bump ruff from 0.0.252 to 0.0.259 (#15328) 2023-03-28 09:46:47 +01:00
stream.py Bump ruff from 0.0.252 to 0.0.259 (#15328) 2023-03-28 09:46:47 +01:00
tags.py Return read-only collections from `@cached` methods (#13755) 2023-02-10 23:29:00 +00:00
transactions.py Remove unused store method `_set_destination_retry_timings_emulated`. (#15266) 2023-03-14 17:32:46 +00:00
ui_auth.py
user_directory.py Improve performance of user directory search (#15729) 2023-06-06 21:16:03 +01:00
user_erasure_store.py