The SELECT query can sometimes be very slow and IO-intensive. Sometimes it even takes longer than the 1 hour request timeout, meaning that it gets stuck without ever making any progress.
@erikjohnston suggests:
I do kinda want to change this, so we have two tables: the current table, and a duplicate which only holds the latest destination/user -> stream ID
There is a cleanup job called
prune_old_outbound_device_pokes
(https://github.com/matrix-org/synapse/blob/v1.93.0/synapse/storage/databases/main/devices.py#L1297-L1388) which periodically attempts to clear out thedevice_lists_outbound_pokes
table a bit.The SELECT query can sometimes be very slow and IO-intensive. Sometimes it even takes longer than the 1 hour request timeout, meaning that it gets stuck without ever making any progress.
@erikjohnston suggests: