Optimise push action processing
See original GitHub issueThis query is responsible for a significant amount of load on our instance and I’d like to optimise it 😃
My first (currently only 😃) suggestion is to store the stream ordering of an event in the receipts_linearized
table (probably as event_stream_ordering
). I believe (will confirm at a later time) that this means both queries can be combined into a much simpler one along the lines of:
SELECT ep.event_id, ep.room_id, ep.stream_ordering, ep.actions,
ep.highlight
FROM event_push_actions AS ep
LEFT JOIN receipts_linearized AS rl USING (room_id, event_id)
WHERE
ep.stream_ordering > rl.stream_ordering
AND ep.user_id = ?
AND ep.stream_ordering > ?
AND ep.stream_ordering <= ?
AND ep.notif = 1
ORDER BY ep.stream_ordering ASC LIMIT ?
This would also optimise a bunch of other queries such as here and here.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
10 Ways to Optimize Your Push Notification Strategy
Taking advantage of a push notification strategy is an effective way to reach users and provide them with immediate, actionable value.
Read more >Push notification guide: Tips and best practices | Adjust
1. No matter how perfect your creative is, your push notifications are worthless if users have not enabled you to send them. However,...
Read more >Step-By-Step Guide To Campaign Optimization - Pushground
Learn everything you need to know about campaign optimization for push ad campaigns and affiliate CPA marketing in this comprehensive guide.
Read more >How To Optimize Your Push Notification Campaigns - Zeropark
Read this comprehensive push notification ads optimization guide to find out exactly how to optimize your push campaigns and boost your ROI.
Read more >Push Notification Best Practices: Improve performance in 2021
7 Push Notification Best Practices for 2021 · 1. Get creative · 2. Push notification character limit – Pay attention to the message...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Progress update: we are using https://github.com/matrix-org/synapse/pull/13918 in our fork and this has yielded significant improvement to the IOPs at all times and in particular during posts in large rooms.
Next up to this is improving the counting of unread actions used when sending pushes: https://github.com/matrix-org/synapse/issues/13846
Adding to to-discuss for the team to consider as another method to optimise event push action processing.