Sobes.tech
Junior — Senior

Determine the number of database queries executed in the shown code fragment

livecode

Task condition

In this example, two records are created in the Post model, and then it is necessary to understand how many database queries will be executed when working with the resulting dataset.


Post.objects.create(name='a')
Post.objects.create(name='b')
———————————————
qs = Post.objects.all()
qs.filter(name__startswith='a')
list(qs)

Answer, how many database queries will occur after the separator line.