views:

13

answers:

0

Hi,

I have an app in app engine which has a lot (expected to be in the range of 10 million + ) of tuples in database. For creating reports based on that app, I need to do a lot of aggregate functions, especially COUNT().

Since GQL does not support COUNT(), the only option seems to be sharding - http://code.google.com/appengine/articles/sharding_counters.html.

Now, since it can send only 1000 items max per query, this means that shard count of 10000 is required to properly handle COUNT of all tuples in the table - say [SELECT COUNT * FROM TABLE] operations. This means that say to get COUNT of all tuples, I have to submit 10K separate queries to GQL.

Even though google suggests that it is ok to have a lot of DB queries, 10K is far too much - in my opinion. Does anyone have any experience in this regard?

Or am I completely mistaken in that there are better ways to do COUNT() function in GQL?

K

related questions