Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow pagination #1233

Open
miky4u2 opened this issue Jul 12, 2023 · 2 comments
Open

Slow pagination #1233

miky4u2 opened this issue Jul 12, 2023 · 2 comments

Comments

@miky4u2
Copy link

miky4u2 commented Jul 12, 2023

I have a collection with 12 million documents and an index on _id . Clicking on the collection to get the first 10 records takes several minutes. It also takes minutes to change the page. There is also the mention of 'delete12564932 retrieved records'. On the other hand, using Mongosh and a query using a combination of sort(), skip() and limit(10) , returns 10 documents instantly and paginating through the 12M records is instant. It seems that mongo-express retrieves the whole collection of every page.
Mongo 6.0.7
mongo-express container from code from a few days ago.

@rtritto
Copy link
Member

rtritto commented Jul 15, 2023

Related discussion: #1091

Did you try latest code on master branch?

@MPoppinga
Copy link

Facing the same problem on large collections. I'm using the latest master, 24dcc13.

Further, setting ME_CONFIG_DOCUMENTS_PER_PAGE does change the value of the skip parameter, but regardless of its value always 100 results are displayed. It looks like that in this case the limit is not run in the database and it always does a COLLSCAN.

I think #1518 is related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants