-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
User collection query has limit set to 10 for a single item fetch #7075
Comments
Another thing to add. During load testing, we observed that the first request takes a decent amount of time (compared to the successive). The query with Have you considered indexing that key since every time authentication makes a query upon that field? |
Hey @vibhor-web-headout — good catches. We will index the These changes should be made to v2 and v3. |
Link to reproduction
No response
Describe the Bug
The following is the query passed to the DB adapter from the flow mentioned the file in the following link:
payload/packages/payload/src/auth/strategies/apiKey.ts
Line 41 in ae7d6f9
The
limit: 10
causes it to do a full collection scan and later once the query is resolved, payload only refers to the first item in the result.CMIIW,
apiKeyIndex
is supposed to be unique for each API-Key, right ?If so, the limit should be 1
To Reproduce
Any API call with payload-token in its cookie would trigger this flow.
Payload Version
2.22.0
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: