title: Django QuerySet update performance
body: <p>Which one would be better for performance?</p>
  
  <p>We take a slice of products. which make us impossible to bulk update.</p>
  
  <pre><code>products = Product.objects.filter(featured=True).order_by("-modified_on")[3:]
  
  for product in products:
    product.featured = False
    product.save()
  </code></pre>
  
  <p>or (invalid)</p>
  
  <p><strike></p>
  
  <pre><code>for product in products.iterator():
    product.update(featured=False)
  </code></pre>
  
  <p></strike></p>
  
  <p>I have tried QuerySet's in statement too as following.</p>
  
  <pre><code>Product.objects.filter(pk__in=products).update(featured=False)
  </code></pre>
  
  <p>This line works fine on SQLite. But, it rises following exception on MySQL. So, I couldn't use that.</p>
  
  <blockquote>
    <p>DatabaseError: (1235, "This version of MySQL doesn't yet support
    'LIMIT &amp; IN/ALL/ANY/SOME subquery'")</p>
  </blockquote>
  
  <p><strong>Edit:</strong> Also iterator() method causes re-evaluate the query. So, it is bad for performance.</p>