fdb-document-layer
fdb-document-layer copied to clipboard
sort() should use indexes
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.
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.