made some sql performance improvements to laod the resources page and menus faster.