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

latency issues due to userid mapping lookup #1094

Closed
mavwolverine opened this issue Jan 6, 2025 · 3 comments
Closed

latency issues due to userid mapping lookup #1094

mavwolverine opened this issue Jan 6, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@mavwolverine
Copy link
Contributor

🐛 Bug Report

We released supertokens to our production environment and everything went became slow then went down.
Analysis showed SELECT * FROM subscriberdb.st_userid_mapping WHERE app_id = 'public' AND (supertokens_user_id = '123' OR external_user_id = '123'); as the top slow query in RDS.

Useful informations

The problem with this query is, it uses OR which does not use indexes for those columns.

@mavwolverine
Copy link
Contributor Author

mavwolverine commented Jan 7, 2025

And our site went down for second time due to row locking on the userid_mapping table.
Screenshot 2025-01-07 at 7 06 04 AM

@mavwolverine
Copy link
Contributor Author

Running a custom core docker image with my fix, and (fingers crossed), so far the site is performing normal!

@mavwolverine
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant