title: Django - annotation produces duplicate joins
body: <p>The following annotation produces duplicates</p>
  <pre><code>.annotate(
          **{
              f&quot;{key}_bundle_id&quot;: F('item__child_link__parent_item__bundle__id'),
              f&quot;{key}_bundle_name&quot;: F('item__child_link__parent_item__bundle__name')
          }
      )
  </code></pre>
  <p>Both of these annotations join across a many to many table to get the id and name of the joined table. I would expect this to produce a join, and select both the id and name from the join.</p>
  <p>Instead it duplicates the join and selects the id from 1 set and the name from the other. Is there a solution to work around this or do annotations always produce their own joins?</p>
  <p>Here's the sql it generates:</p>
  <pre><code>SELECT T8.id as x_axis_bundle_id, T12.name as x_axis_bundle_name
  ....
  INNER JOIN &quot;item&quot; ON (&quot;gmdts&quot;.&quot;item_id&quot; = &quot;item&quot;.&quot;id&quot;)
  INNER JOIN &quot;link&quot; ON (&quot;item&quot;.&quot;id&quot; = &quot;link&quot;.&quot;child_id&quot;)
  INNER JOIN &quot;item&quot; T8 ON (&quot;link&quot;.&quot;parent_id&quot; = T8.&quot;id&quot;)
  INNER JOIN &quot;bundle&quot; T9 ON (T8.&quot;id&quot; = T9.&quot;item_id&quot;)
  INNER JOIN &quot;link&quot; T10 ON (&quot;item&quot;.&quot;id&quot; = T10.&quot;child_id&quot;)
  INNER JOIN &quot;item&quot; T11 ON (T10.&quot;parent_id&quot; = T11.&quot;id&quot;)
  INNER JOIN &quot;bundle&quot; T12 ON (T11.&quot;id&quot; = T12.&quot;item_id&quot;)
  </code></pre>