Question

I've used "select from X.class.getName()" to get all records of class X, but if there is a lot of records, it might take a long time to get the results.

I just want a count of how many records are there in the Datastore, what's the fastest query to get this number ? Is there something like "select COUNT() X.class.getName()" that can return , for example, 234000 [ the count of all records ] ?

Was it helpful?

Solution

See What's the best way to count results in GQL?

(short answer is that you should store the amount of object and update it whenver you add/remove objects from the datastore)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top