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]>
> > .
> > 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.

Reply via email to