eherve / mongoose-datatable

Server side dataTable request support for mongoose
MIT License
42 stars 28 forks source link

MongoDB uses non-optimal query indexes because of sort #57

Closed adrianjarc closed 5 years ago

adrianjarc commented 5 years ago

@eherve More is explained in pull request #56.

adrianjarc commented 5 years ago

@eherve So when will this be seen in new version of plugin?

eherve commented 5 years ago

I’ll publish this week on npm I’m rewriting the plugin to use lookup for populated fields and I’ll integrate your dev as well.

Thanks by the way

adrianjarc commented 5 years ago

No problem. This plugin is awesome and works like a charm. There is only one other plugin that enables serverside datatables processing in node + mongo but it does not have all the features this one has (except that one doesn't use aggregation pipeline, but instead uses normal .find().sort().skip().limit().... query). So I rather fix this plugin that works better and only has one minor issue and it isn't even plugins fault (it's MongoDB's). So after I spent 3 days analysing what is happening and optimizing indexes on our DB and still had no success at speeding up some queries I dug deep and found MongoDB bug that is mentioned in pull request. And decided to fix this plugin.

So looking forward to new release so I can update and hopefully have some speedier results. Hoping I will be notified for new version (Will close this issue once new version is out).

eherve commented 5 years ago

Thanks,

I just published the version 1.0.7 on npm. Let me know if it is ok.

adrianjarc commented 5 years ago

Version is OK.

eherve commented 5 years ago

You can test the next version (2.0.0) by adding it to your projet if you want : npm install --save git+ssh://git@github.com/eherve/mongoose-datatable.git