question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optimise push action processing

See original GitHub issue

This 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:open
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Fizzadarcommented, Oct 10, 2022

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

1reaction
anoadragon453commented, Aug 22, 2022

Adding to to-discuss for the team to consider as another method to optimise event push action processing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found