I have an ordered table defined as following in model.py (Blog is another table):
class OrderedBlog(Blog):
class Meta:
ordering = ["-time_created"]
proxy = True
If I try to do something like:
OrderedBlog.objects.filter(time_created__lt = a_specific_time)
Would this bring all entries of Blog in memory? Thanks!
No it wont. When you are going to iterate over the the queryset, then Django will start loading each element of the queryset into memory and instantiate it one at a time.
If you are concerned about memory usage you’d better go for Queryset.iterator() or retrieve only the fields you are interested in using only.