Use partialsum field to reduce memory usage.