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
fix: detect findUniqueOrThrow as a compactable findUnique operation #4014
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hayes.
Not compacting findUniqueOrThrow
at the moment is intentional (#3458, prisma/prisma#16548), as it would involve more work then just batching the queries into single SQL statement. I believe this PR just brings prisma/prisma#16548 back and does not actually fix the batching, (see queries::batch::select_one_singular::singular_batch::repro_16548
test).
We will be willing to merge proper fix for *OrThrow
variant batching, but this PR needs more work at the moment.
CodSpeed Performance ReportMerging #4014 Summary
|
@SevInf thanks for taking a look, and sorry for opening the PR without actually getting my tests running locally. I looked at this a bit more today, and the proper fix doesn't seem overly complicated, but this is my first time looking at prisma-engine, so I may be missing some things. I've updated the PR with a basic implementation to test that my understanding is correct, but there are a few things I could use some help figuring out:
|
...y-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/select_one_singular.rs
Outdated
Show resolved
Hide resolved
...y-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/select_one_singular.rs
Outdated
Show resolved
Hide resolved
@hayes I'm looking into the updated patch today and your questions and will provide feedback soon. Thank you very much! |
detect findUniqueOrThrow small fixes
Thanks @miguelff, merged your changes, let me know if there is anything else you need me to do |
Superseded by #4019. I'm taking it from there. |
Currently findUniqueOrThrow callas are not being compacted/optimized like findUnique calls. As far as I can tell, there is no reason this would be intentional, and many other checks for isFindUnique currently do something equivelent to
name.startsWith('findUnique')