Skip to content

fix: INFRA-1562 optimize prisma adapter for big queries#7464

Merged
sitozzz merged 1 commit intomainfrom
fix/optimize-prisma-big-relations-loading
Apr 13, 2026
Merged

fix: INFRA-1562 optimize prisma adapter for big queries#7464
sitozzz merged 1 commit intomainfrom
fix/optimize-prisma-big-relations-loading

Conversation

@sitozzz
Copy link
Copy Markdown
Member

@sitozzz sitozzz commented Apr 13, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Warning

Rate limit exceeded

@sitozzz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 36 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 36 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43bdb48e-09da-4536-8ba3-d25203914c73

📥 Commits

Reviewing files that changed from the base of the PR and between 17f35bd and 163edc2.

📒 Files selected for processing (1)
  • packages/keystone/databaseAdapters/adapters/PrismaAdapter.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/optimize-prisma-big-relations-loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sitozzz sitozzz force-pushed the fix/optimize-prisma-big-relations-loading branch from 4d7ef77 to 163edc2 Compare April 13, 2026 12:59
@sitozzz sitozzz merged commit 978100c into main Apr 13, 2026
1 check passed
@sitozzz sitozzz deleted the fix/optimize-prisma-big-relations-loading branch April 13, 2026 12:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 163edc27df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +332 to +333
const parts = await Promise.all(chunkedQueries.map(chunkQuery => model.findMany(chunkQuery)))
return parts.flat()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve NOT semantics when chunking large filters

_findManyWithChunking always merges chunked queries with a union (parts.flat()), which changes semantics for negative predicates. For example, splitting where: { NOT: { id: { in: [...] } } } into chunks and unioning results returns (NOT chunk1) OR (NOT chunk2) instead of the required (NOT chunk1) AND (NOT chunk2), so large NOT ... in filters can match far too many rows. This path is now used by every-style relationship processing, so large inputs can produce incorrect query results.

Useful? React with 👍 / 👎.

@sonarqubecloud
Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant