-
Notifications
You must be signed in to change notification settings - Fork 394
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
Users table index on recovery_token is not being used in queries #1398
Labels
bug
Something isn't working
Comments
2 tasks
J0
added a commit
that referenced
this issue
Mar 4, 2024
…ueries (#1454) ## What kind of change does this PR introduce? Use the nil instance ID so that we can leverage the compound index on instance_id and user_id when performing search and deletion Aims to address #1449 and #1398. We note that `LogoutAllRefreshTokens` was marked as deprecated and may be possible to remove if all access tokens now have a `sessionId`. Additionally, `FindTokenBySessionID` can likely be replaced by using `FindCurrentlyActiveRefreshToken`. We will revisit these in a week or two but they are out of scope for this PR. Co-authored-by: joel <[email protected]>
closing as this has been deployed - let us know if there are still issues though |
uxodb
pushed a commit
to uxodb/auth
that referenced
this issue
Nov 13, 2024
…ueries (supabase#1454) ## What kind of change does this PR introduce? Use the nil instance ID so that we can leverage the compound index on instance_id and user_id when performing search and deletion Aims to address supabase#1449 and supabase#1398. We note that `LogoutAllRefreshTokens` was marked as deprecated and may be possible to remove if all access tokens now have a `sessionId`. Additionally, `FindTokenBySessionID` can likely be replaced by using `FindCurrentlyActiveRefreshToken`. We will revisit these in a week or two but they are out of scope for this PR. Co-authored-by: joel <[email protected]>
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this issue
Nov 13, 2024
…ueries (supabase#1454) ## What kind of change does this PR introduce? Use the nil instance ID so that we can leverage the compound index on instance_id and user_id when performing search and deletion Aims to address supabase#1449 and supabase#1398. We note that `LogoutAllRefreshTokens` was marked as deprecated and may be possible to remove if all access tokens now have a `sessionId`. Additionally, `FindTokenBySessionID` can likely be replaced by using `FindCurrentlyActiveRefreshToken`. We will revisit these in a week or two but they are out of scope for this PR. Co-authored-by: joel <[email protected]>
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this issue
Nov 15, 2024
…ueries (supabase#1454) ## What kind of change does this PR introduce? Use the nil instance ID so that we can leverage the compound index on instance_id and user_id when performing search and deletion Aims to address supabase#1449 and supabase#1398. We note that `LogoutAllRefreshTokens` was marked as deprecated and may be possible to remove if all access tokens now have a `sessionId`. Additionally, `FindTokenBySessionID` can likely be replaced by using `FindCurrentlyActiveRefreshToken`. We will revisit these in a week or two but they are out of scope for this PR. Co-authored-by: joel <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
The following query, which should be nearly instant, accounts for 8% of our DB usage and 1500 ms per query:
On investigation this query is running a seq_scan instead of using the index on recovery_token:
This is the index in question:
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Run:
Expected behavior
Should be nearly instant and use index in query plan
The text was updated successfully, but these errors were encountered: