never tried this, but is it faster/less CPU if you use:

http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html#Deleting_an_Entity

like in second example that you do:
db.delete(trackers)

cheers,

Perica

On Sep 11, 9:00 pm, someone1 <someo...@gmail.com> wrote:
> I have tried asking/researching this before, but I really need a more
> efficient way to delete mass amounts of data from the datastore. In
> short, I am only able to remove .1GB for 6.5 hrs of CPU time, and all
> of that is datastore time.
>
> Here is the code:
>
> class DeleteKeywords(webapp.RequestHandler):
>     def get(self):
>         try:
>             trackers = Tracking.all().filter('delete_track',True)
>             for x in trackers:
>                 keys = db.query_descendants(x).fetch(100)
>                 while keys:
>                     db.delete(keys)
>                     keys = db.query_descendants(x).fetch(100)
>                 x.delete()
>         except DeadlineExceededError:
>             queue = taskqueue.Queue(name='delete-tasks')
>             queue.add(taskqueue.Task(url='/tasks/delete_tracks',
> method='GET'))
>             self.response.out.write("Ran out of time, need to delete
> more!")
>
> Its really small and simple, and I did not think it'd use up soo much
> CPU time. Why is it that the API CPU time is soo much smaller than the
> Datastore CPU time? Is there any way to consume more of the datastore
> time than the API CPU time?
>
> I'd really like to clear out that database without needing to wait
> almost 50 hours worth of CPU time (which is odd since it runs for
> maybe 30 minutes - 1 hour, only 1 task a minute, and it uses up all
> that time... is it calculating wrong?)
>
> Anybody have any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to