payload: Slow-query of payload 1.6 takes me about 10s to load an article list of nearly 30k documents
It takes me about 10s to load the article list

I inspected the slow API. If I remove the draft option. I will be very fast.
https://mysite.com/api/articles?locale=en&depth=0&draft=true&limit=10
vs
https://mysite.com/api/articles?locale=en&depth=0&limit=10
And it cannot reproduce in my local machine.
And I ran the migration script as the document said. https://github.com/payloadcms/payload/blob/master/CHANGELOG.md#-versions-may-need-to-be-migrated
_Originally posted by @Stupidism in https://github.com/payloadcms/payload/discussions/2217_
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 35 (35 by maintainers)
Hey @Stupidism — I think this is definitely the move.
The team and I have been discussing a way to do exactly this, and I think this will circumvent your issue.
Give us a bit here and we will get a plan in place to make this or something similar to this happen.
Yes, this issue has been a thorn in our side for quite some time now but I am pretty confident that this new approach will 100% solve this issue for all Mongo-like databases from here on out.
It will be defaulted in 2.0, and we wanted to get it out now as a feature flag so you guys don’t have to wait 👍 thanks to Jarrod for the quick moves here!
It should have the same affect on DocumentDB, since it removes the need for the aggregation step when querying drafts!
Oops - did not mean to close. I didn’t even know I did!
Question - is there a way that you could clone your exact database, run on Atlas (or a local MongoDB Community), and then re-assess the speed here?