fdb-document-layer icon indicating copy to clipboard operation
fdb-document-layer copied to clipboard

sort() should use indexes

Open apkar opened this issue 6 years ago • 1 comments

Query planner uses indexes only to satisfy predicates. Sorting is done in memory. If we have a query like db.coll.find().sort('section').limit(5), without indexes, it would have to bring in all documents into memory and sort. Whereas with indexes, assuming index on section is present it just has to fetch 5 documents. It's bad both in terms of the number of keys that needs to be fetched from FDB and memory utilization.

apkar avatar Jan 25 '19 07:01 apkar

Is there any update or any plans regarding this issue? We'd love to replace MongoDB with fdb-document-layer in https://github.com/mistio/mist-ce and this is the main showstopper.

d-mo avatar Jan 17 '20 02:01 d-mo