MongoDB slow delete with onDelete: SetNull
#19169
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: indexes
topic: mongodb
topic: performance/queries
topic: relationMode
formerly `referentialIntegrity`
topic: relations
Milestone
Bug description
When having a schema with a 1:n relation where you delete the left side. It takes on big collections (>1.Mio documents) long time to delete the document (>1 minute).
How to reproduce
You generate a bad query to check the depending documents
There need to be a query which can use the normal index in mongodb like
db.Broadcast.find({productionId: ObjectId(\"5f913feb235d8600075e1797\")})
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: