On Oct 25, 8:22 am, ramu <[email protected]> wrote:
> As I understand, query result are fetched in batches so even if we process
> only couple of entities from a query, does it charge for the complete batch
> operation ??
>
> What is the datastore-read-count if i call query_object.get(), which returns
> me just the 1st entity ?
>
> It is not exactly clear about Query calls on this
> page.http://www.google.com/enterprise/cloud/appengine/pricing.html
When you call get() on a query, the batch size is set to 1, so no
worries. Similar if you do query_object.fetch(N) -- the batch size is
adjusted to avoid fetching more than N objects.
The only time where you would be fetching unneeded options is if you
use a for-loop over the query and then break. E.g. the following is a
bad way to fetch the first 3 hits:
# Don't do this!
hits = []
for entity in query_object:
if len(hits) >= 3:
break
hits.append(entity)
# Don't do this!
--Guido van Rossum
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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?hl=en.