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

Don't ask the database for user ids which are not emails #676

Merged

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Jul 8, 2021

User ids in the guest app are always emails, so there is no
use in querying the database when there is no @ in the user id.

Commit 1 saves 18.061 queries from our famous query log
Commit 2 saves 17.898 queries from our famous query log

User ids in the guest app are always emails, so there is no
use in querying the database when there is no @ in the user id.

Signed-off-by: Joas Schilling <coding@schilljs.com>
…eady

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

Regarding the second commit, we queried the user id twice all the time:

queries from our famous query log:

		2397678 Query	SELECT `uid`, `displayname` FROM `oc_guests_users` WHERE `uid_lower` = 'f@g.h'
		2397678 Query	SELECT `uid` FROM `oc_guests_users` WHERE `uid_lower` = 'f@g.h'
		2397719 Query	SELECT `uid`, `displayname` FROM `oc_guests_users` WHERE `uid_lower` = 'e@j.k'
		2397719 Query	SELECT `uid` FROM `oc_guests_users` WHERE `uid_lower` = 'e@j.k'
		2397678 Query	SELECT `uid`, `displayname` FROM `oc_guests_users` WHERE `uid_lower` = 'c@d''
		2397678 Query	SELECT `uid` FROM `oc_guests_users` WHERE `uid_lower` = 'c@d'
		2397719 Query	SELECT `uid`, `displayname` FROM `oc_guests_users` WHERE `uid_lower` = 'A@B'
		2397719 Query	SELECT `uid` FROM `oc_guests_users` WHERE `uid_lower` = 'A@B'

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

change looks fine 👍

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

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍 for the tests

@juliushaertl juliushaertl merged commit 870cf96 into master Jul 8, 2021
@juliushaertl juliushaertl deleted the bugfix/noid/dont-ask-the-database-on-non-email-users branch July 8, 2021 16:13
@nickvergessen
Copy link
Member Author

Can we release a new version until monday so we have a new deployment in the next company call?

@juliushaertl
Copy link
Member

I can do that tomorrow

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

Successfully merging this pull request may close these issues.

None yet

3 participants