This PR address the issue with total_entries being incorrect when using joined tables. When we join tables SQL's COUNT includes duplicate rows created by the join, leading to an inflated total count.
So, instead of counting rows directly in the joined query, we count distinct instances using an unique identifer e.g. primary key from one of our tables.
This PR address the issue with
total_entries
being incorrect when using joined tables. When we join tables SQL'sCOUNT
includes duplicate rows created by the join, leading to an inflated total count.So, instead of counting rows directly in the joined query, we count distinct instances using an unique identifer
e.g. primary key
from one of our tables.Cc @katamartin