Improve admin dashboard database queries