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

Support arbitrary result sorting in views and/or mango #1511

Open
wohali opened this issue Aug 7, 2018 · 1 comment
Open

Support arbitrary result sorting in views and/or mango #1511

wohali opened this issue Aug 7, 2018 · 1 comment

Comments

@wohali
Copy link
Member

wohali commented Aug 7, 2018

@davisp:

We have sorting. Though I'm assuming you mean sorting any result set based on some selected field. This makes me squeamish for similar reasons to JOINS in that the resource usage is unbounded and also involves a significant increase in complexity vs what I'm not sure would lead to equivalent gains in usefulness.

For reference, this is from the MongoDB docs on sorting limits [1]:

"If MongoDB cannot use an index to get documents in the requested sort order, the combined size of all documents in the sort operation, plus a small overhead, must be less than 32 megabytes."

So basically, a query will work until it suddenly doesn't if your data set happens to exceed 32MiB. Obviously you wouldn't want to just not cap the memory usage here as a bad query could OOM your server. And I swear that value used to be 4MiB and has since been bumped because I assume people kept getting angry that their queries would seem to randomly failed after their app had been used a while.

[1] https://docs.mongodb.com/manual/reference/limits/#Sort-Operations

@wohali
Copy link
Member Author

wohali commented Aug 7, 2018

Worth saying here @davisp that if Mongo can get away with a 32MB limit, we could too.

@wohali wohali added this to In Discussion in Roadmap Aug 7, 2018
@wohali wohali moved this from Proposed for 3.x to Proposed (release independent) in Roadmap Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Roadmap
  
Proposed (backlog)
Development

No branches or pull requests

1 participant