Minor performance changes

王权利请求将github/fork/rspeicher/misc_performance合并到master

Created by: rspeicher

Makes Issue and MergeRequest use a counter cache for its notes association. Adds includes queries to a few places where it would benefit from eager loading.

Also reduces the queries generated by Ability from four on every single project page down to one.

合并请求报告