Django logs SQL operations to an internal buffer (whether logging to file or not) when settings.DEBUG=True. Because I have long-running process that does a lot of DB operat
If still interested in tracing SQL operations for debugging purposes, you can also clean connection.queries list periodically to reclaim memory:
from django.db import connection
for i in range(start, count, size):
objects = MyModel.objects.order_by('pk').all()[i:i + size]
...
print connection.queries
connection.queries = []