-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MongoDB Query with 'in' condition will cause COLLSCAN, without leveraging indexes #19955
Copy link
Copy link
Closed
Closed
Copy link
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: intopic: indexestopic: mongodbtopic: performance/queries
Milestone
Description
Bug description
how to reproduce this issue:
const result = await this.prisma.ANY_COLLECTION.updateMany({ where: { id: { in: idsToUpdate, }, }, })
And it will cause a COLLSCAN, even the field already has index. It's getting really bad performance on our production database and no other way to fix this.
I have seen a lot of similar issue for several months just like #14871 and #12793
Why is this fatal bug still not fixed after months? If prisma is abandoning support for mongodb, please let us know. We'll migrate to other ORM as soon as we can.
How to reproduce
Expected behavior
No response
Prisma information
// Add your schema.prisma// Add your code using Prisma ClientEnvironment & setup
- OS: MacOS & Ubuntu 2004
- Database: Mongodb 6.0.6
- Node.js version: 18.15.0
- Prisma version: 4.15.0
Prisma Version
4.15.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: intopic: indexestopic: mongodbtopic: performance/queries