Here are some stats: http://bthomson-test-app.appspot.com/ancestor_tests
create and put 50 models using db.put(models) Billable API CPU time: 2900 mcycles get 50 models using db.get(keys) Billable API CPU time: 500 mcycles delete 50 models using db.delete(keys) Billable API CPU time: 1250 mcycles On Feb 20, 7:41 am, kang <[email protected]> wrote: > Hi peterk, maybe the delete() operation uses the most CPUs :) Anyway, I > will have a test, thanks > > > > > > On Sat, Feb 20, 2010 at 8:16 PM, peterk <[email protected]> wrote: > > I've never tested this, but is it possible you'd see better 'per- > > delete' cost with a larger batch? > > > Maybe try the maximum number of entities in a batch (500, I think), > > calculate the average cost per entity, and see if that's any better? > > > On Feb 20, 11:41 am, kang <[email protected]> wrote: > > > Thanks, Andrew. But after the change, it still costs me 2130cpu_ms > > > 2112api_cpu_ms :) > > > > On Sat, Feb 20, 2010 at 5:22 PM, Andrew Chilton <[email protected] > > >wrote: > > > > > On 20 February 2010 21:21, kang <[email protected]> wrote: > > > > > I'm going to clear the datastore. I use the following code: > > > > > old_date = datetime.datetime(2009,10,1) > > > > > old_updates = SomeUpdate.all().filter("updated > > <",old_date).fetch(20) > > > > > db.delete(old_updates) > > > > > it costs me nearly 1982cpu_ms 1945api_cpu_ms every time. Is it > > normal? > > > > > You might be able to save some time by using a keys_only query. See > > > > this for details. > > > > >http://code.google.com/appengine/docs/python/datastore/modelclass.htm. > > .. > > > > > Cheers, > > > > Andy > > > > > -- > > > > contact: Andrew Chilton > > > > website:http://www.chilts.org/blog/ > > > > > -- > > > > 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]<google-appengine%2Bunsubscrib > > > > [email protected]><google-appengine%2Bunsubscrib > > [email protected]> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/google-appengine?hl=en. > > > > -- > > > Stay hungry,Stay foolish. > > > -- > > 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]<google-appengine%2Bunsubscrib > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-appengine?hl=en. > > -- > Stay hungry,Stay foolish. -- 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.
