On May 1, 12:28 pm, Liang Zhao <[email protected]> wrote:
> I'm not sure, but it seems both
>
> alerts = Alert.all().filter('expires >= ', datetime.datetime.now())
>
> and
>
> alerts = Alert.all().filter('expires >= ', 
> datetime.datetime.now()).fetch(1000)
>
> should be the same, since according to documents, app engine only
> return the first 1000 records.

Fetching the records as a batch and then doing stuff with them is
faster than treating a db.Query object as an iterable.

On the other hand, fetch(1000) is fairly likely to get you a datastore
timeout, depending on your data.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to