eherve / mongoose-datatable

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

performance? #47

Closed jerome-chen closed 5 years ago

jerome-chen commented 8 years ago

This works fine if the data is not large, however for now, I have around 450K rows in the mongo collection and the performance is significantly dropped. The first page takes like more than 10 secs to load. Is there any thing that we can do to improve it?

eherve commented 8 years ago

Hi,

Thank you for your feedback.

Can you give me the query print when you activate debug mode on the module please. I'll see what query is made.

What does the module do is fetching the all count of the data then the filtered count (if filtered) then it uses aggregate to get the data from the root model. If you have populate then it will trigger a fetch for all populate data.

Performances will be affected if you have populates in the fetch, the size of the page you are getting and if you filter the query specially if you have array sub documents.

By the way, do you have a cluster of mongoldb ?

Regards