You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to try out performance optimizations via indexes. As I wanted to start small, I used the example in databases/mongodb. In the folder I ran docker-compose --file docker-compose.yml up --detach followed by a
When trying the same (The same means generating the index as described but generating the collection isn't done via prisma, because it needs a replica set.) against another mongo image (e.g.image: mongo:6-jammy) it works:
Creating the index doesn't hang but returns immediately
Hi.
I wanted to try out performance optimizations via indexes. As I wanted to start small, I used the example in
databases/mongodb
. In the folder I randocker-compose --file docker-compose.yml up --detach
followed by aThis worked as expected, the entry was in the collection
prisma-mongo/User
.Then I added an index via the Mongodb client (
yarn add mongodb@6.3
) followed by aThis script hangs forever and never completes.
When looking at the indexes via MongoDB Compass it looks like the index is created correctly though:
But this index never gets used. Doing a simple query like
{ firstName: { $eg: "Hana"} }
, explain gives the following:So it uses a
COLLSCAN
instead of aIXSCAN
.When trying the same (The same means generating the index as described but generating the collection isn't done via prisma, because it needs a replica set.) against another mongo image (e.g.
image: mongo:6-jammy
) it works:IXSCAN
The only idea google came up with was this: https://stackoverflow.com/a/65699029 still I have no idea how to apply this.
Any ideas?
The text was updated successfully, but these errors were encountered: