seller is the ID of the seller, like a hash, and the createdAt is an unix timestamp.
So, the collection has a total of 21k documents and this query returns about 1.100 results. But the problem is that, it is taking about 15-20 seconds to complete and I think that’s a lot of time, because I dont have much documents and results.
And that’s it. The transaction object stored there doesnt contain much information, (I mean, it is not heavy at all). What could be the problem?
Note: I don’t know if it can be the problem but my application is probably running other queries while this one is running. (Because I have scripts working 24/7 collecting and storing data).
As @steevej has mentioned, kindly post the explain plain for us to better understand and help you with the problem. I also noticed that your included schema snippet does not have any index declarations, which could be one of the reasons for the slow queries. I suggest adding the appropriate compound index to support that query if you are not already using them.
I also noticed you had a very similar discussion here as well:
Did this discussion help resolve this problem or something is still left to be resolved?