On Wednesday 31 May 2017 12:13:48 'Abraham Varricatt' via Django users wrote:
> If I want to get the total count from both tables it can be done like > this, > > author_count = Author.objects.count() > publisher_count = Publisher.objects.count() > > My concern is that this results in two different queries to the > database. Can it be done with a single query call? Why is that a concern? This isn't the kind of thing to optimize. Query optimization is about loops and relations. Not about getting information you need - it comes at a price. Have you timed what you could save? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3906536.yyyTSluoAH%40devstation. For more options, visit https://groups.google.com/d/optout.

