You are likely running the 60 sec query limit.  Try using cursors 
(https://developers.google.com/appengine/docs/python/datastore/queryclass#Query_with_cursor)
 
and running the job as a cron or in a backend instance.



On Friday, September 14, 2012 6:17:03 PM UTC+5:30, Naveed Ahmad wrote:
>
> i have got into strenge situation. I want to know count of Fetch based on 
> daily, weekly, monthly and All time. in Datastore, their count is about 
> 2,368,348 whenever i try to get count either by Model or GqlQuery gets 500 
> error. when rows are less, code below working fine..
>
> can any guru correct me or tell me right solution, please?
>
> please check code below in python...
>
> The Model:
>
> class Fetch(db.Model):
>     adid = db.IntegerProperty()
>     ip = db.StringProperty()
>     date = db.DateProperty(auto_now_add=True)
>
> Stats Codes:
>
> adid = cgi.escape(self.request.get('adid'))
> ...
> query = "SELECT __key__ FROM Fetch WHERE adid = " + adid  + " AND date >= :1" 
>  
> rows = db.GqlQuery( query, monthlyDate)
> fetch_count = 0
> for row in rows:
>    fetch_count = fetch_count + 1
> self.response.out.write( fetch_count)
>
> thanks, -Navi
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/6ey0OUuhzWQJ.
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