Duplicate joins & offsets in count expression
Hi! I'm doing some complex count operations and the query builder is making some decisions that I do not understand.
Essentially, I'm doing this query:
Very complex query, so I'd expect the count op to be complex, but I feel its a little un-optimized.
This generates the following SQL (flag1 = false, so it's filtering based on
Essentially, I'm doing this query:
Very complex query, so I'd expect the count op to be complex, but I feel its a little un-optimized.
This generates the following SQL (flag1 = false, so it's filtering based on
foreignTable1):