In my database (mongoDB) I have a model called exam and each instance of the modal has a somewhat large json object (500k).
I'm using strapi cms to make the query, using graphql plugin.
However when fetching all the ids of the model, the fetching is extremely slow even though i'm only interested in the ids and the json object inside each instance (using graphql):
query {
exams {
name,
_id,
}
}
This is in comparison with fetching of other models which is very fast.
Does the database read through the whole content of each instance of a model? Is there a way to change this behaviour?
This is not a bug, just asking for help.
slowms
threshold (100ms by default). You could also enable the Database Profiler to collect details about queries being executed. You may be missing an ideal index to support your queries. – Stennie Feb 18 '19 at 10:01explain()
your queries in order to understand index usage. – Stennie Feb 18 '19 at 10:01