title: Iterate through lots of records and aggregate an integer property in Google App Engine - java
body: <p>Google App Engine - Java - JDO</p>
  
  <p>I'm storing an object "Bucket" in the datastore that has a field/property of "totalsize" - an integer that is an aggregate of all the size of the associated blobs of the Bucket. Each Bucket has 3 corresponding blobs. This field gives me the total size in bytes of all three of it's blobs. I'm aggregating this count when I put the blobs into the datastore.</p>
  
  <p>Now, I say I have MILLIONS of these Buckets. How can I get a total aggregate of all the totalsize fields in all of the Buckets? These buckets relate to an Account object. Essentially, I'd like to determine the total amount of data under management per account.</p>
  
  <p>Obviously I'm looking for the best way to do this. I doubt that retrieving them all and looping through is a possibility.</p>
  
  <p>Thanks!</p>