How to avoid SELECT sql generated by Django model’s save method?

by , under django

Django framework is designed for novice users in mind and so they try to keep things simple at the cost of performance. Once such is the Django model’s save method. Every save fires first a SELECT statement to verify if a record exists with the provided “id” and then does update if exists else insert. As a good framework django does provide the flexibility to control this. You can pass the force_update=True to save method if you know for sure that the id exists already and the call to django model save avoids the SELECT sql before insert.
Same goes for insert too. You set the force_insert=True in that case.