Fetching comprehensive statistics from database