python - Django Filtering performance if using [:max] -
assume have table 100000 entries doing :
a = model.object.all()[:10]
will sql limit request 10 or django generate sql table , provide me 10 entries?
that's python question more django, want make sure not doing wrong.
django use sql limit.
class m(models.model): pass ... print m.objects.all()[:10].query # select "app_m"."id" "app_m" limit 10
Comments
Post a Comment