Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize getting the latest events in each room #436

Merged
merged 3 commits into from
May 20, 2024

Conversation

S7evinK
Copy link
Collaborator

@S7evinK S7evinK commented May 17, 2024

As mentioned internally, this significantly speeds up getting the latest event in each room provided.

Output of EXPLAIN ANALYSE

 Planning Time: 0.408 ms
 Execution Time: 9158.038 ms

for the original with a cold cache

 Planning Time: 0.296 ms
 Execution Time: 101.383 ms

with a warm cache.

The optimized query with a cold cache:

 Planning Time: 1.902 ms
 Execution Time: 3.752 ms

and with a warm cache:

 Planning Time: 0.425 ms
 Execution Time: 0.131 ms

Copy link
Member

@kegsay kegsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@kegsay kegsay merged commit 425a5d4 into main May 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants