resolve sql sum preformance