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

Less participant queries #4189

Merged
merged 2 commits into from
Sep 22, 2020
Merged

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Sep 21, 2020

Should reduce the number of those queries a lot:

SELECT * FROM `oc_talk_participants` WHERE (`user_id` = 'xxx') AND (`room_id` = '1234')

and will instead left join the participant on the initial query. That in itself is not a big help. But in case we ask for the same participant more than once (hint, happens every time), we save N-1 queries

it was 1122 queries of the 7873 in our query log

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

Noice!

@nickvergessen nickvergessen force-pushed the feature/noid/less-participant-queries branch 2 times, most recently from b55e864 to 36548c4 Compare September 22, 2020 09:10
Signed-off-by: Joas Schilling <coding@schilljs.com>
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Unit tests need to be adjusted.

Signed-off-by: Joas Schilling <coding@schilljs.com>
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@nickvergessen nickvergessen merged commit 5bd5779 into master Sep 22, 2020
@nickvergessen nickvergessen deleted the feature/noid/less-participant-queries branch September 22, 2020 19:11
@nickvergessen
Copy link
Member Author

/backport to stable20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants