Count vs len on a Django QuerySet
I think using len(qs) makes more sense here as you need to iterate over the results. qs.count() is a better option if all that you want to do it print the count and not iterate over the results.
len(qs) will hit the database with select * from table whereas qs.count() will hit the db with select count(*) from table.
also qs.count() will give return integer and you cannot iterate over it
In Django, given that I have a QuerySet that I am going to iterate over and print the results of, what is the best option for counting the objects? len(qs) or qs.count()?
(Also given that counting the objects in the same iteration is not an option.)