Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does GQL support commonly available SQL Style aggregation?

What I'm looking for a simple Aggregate Functions that are widely available in versions of SQL.

Simple things like Select Count(*) from table1 to the more complex.

If these are available, is there some documentation you could point me to?

Thanks - Giggy

like image 223
Giggy Avatar asked Apr 11 '09 00:04

Giggy


1 Answers

The SQL aggregate functions are not available. What you want to do is follow patterns like the sharded counters example: http://code.google.com/appengine/articles/sharding_counters.html which explain that instead of aggregating the values on queries, you want to keep the counters up to date when the values are inserted, updated, or deleted.

The example takes the concept a bit further than just maintaining the aggregates in that it will explain how to make it so that you can update the counters under high load where you have a limited amount of opportunity to write to your counters - so the shards help you distribute the load over several instances.

like image 61
dar Avatar answered Oct 20 '22 06:10

dar