increase insertion speed in python
Question: I have a script in django which i am running on terminal to update the field
values in database , there is about 3000 records to be updated , it updated
but it takes so much time.

Here is the code:

    
    
    getAge  = myplayer.objects.all()
    for i in getAge:
        i.age  = i.age + 0.0192         # it is equilant to  1/52
        i.save()    
        print  "new age of id - " ,i.id, "is ", i.age 
    

I am using a MYSQL DB please suggest how can i speed up the insertion time

thanks


Answer: If you don't need to print new ages, you can do as follow using
[F](https://docs.djangoproject.com/en/1.5/topics/db/queries/#query-
expressions):

    
    
    from django.db.models import F
    myplayer.objects.update(age=F('age')+0.0192)
    

