I’ve built an contact manager/lightweight CRM application and am now starting to optimize it for speed as speed is becoming an issue.
The table shown below is the slowest part of the application now. It loads via jquery Datatables (server-side). I am running miniprofiler to show queries and load times. I think the fix is some sort eager loading or pre-joining of tables. However I’m confused about the duration vs Query Time.
The duration of executing index action is 3800+ms , but the query time is 306ms.
My server logs reflect something similar: “Completed 200 OK in 3832ms (Views: 2205.9ms | ActiveRecord: 1613.3ms)”
If i optimize the queries, am I working on the smaller problem? Why do the views take so long or are they closely related?
What am I not thinking of?