Someone told me DatastoreService.prepare(query).countEntities(); can
only count 1000 entities at most.

I solved this problem by applying a shard counter

On Feb 4, 7:06 am, David Chandler <[email protected]> wrote:
> Or would this would be more efficient if all you need is a count?
>
> DatastoreService.prepare(query).countEntities();
>
> I don't know the answer, but I've been wondering the same thing...
>
> /dmchttp://turbomanage.wordpress.com
>
> On Feb 2, 10:05 pm, Max <[email protected]> wrote:
>
> > Hi,
>
> > I am designing my data model and planning to use following KeysOnly
> > query to perform a count(*) with some filter conditions by a daily
> > cron job.
>
> > FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0).limit
> > (Integer.MAX_VALUE);
> > DatastoreService.prepare(query).asList(fetchOptions).size();
>
> > Here are my questions:
> > 1, if I use an ancestor query (in a transaction) over an entity group
> > with around 1 million records of this kind, how is the performance?
>
> > 2, if I use an ancestor query without a transaction (to avoid locking
> > whole entity group), how is the performance?
>
> > 3, if I use a normal query over around 1k entity groups with around 10
> > million records of this kind, how is the performance?
>
> > Many thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to