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