Duplicate queries can appear on JOINs, depending on:
1. The join type/conditions
2. The number of results on either side of the join.
Problems come about when the joined table produces more than one possible result. This is confirmed with `INNER JOIN`.
## Review Board
Here are some joins that are verified to produce duplicates.
```python
ReviewRequest.objects.filter(target_groups__in=[1, 2])
ReviewRequest.objects.filter(Q(target_groups__in=[3]) | Q(target_people__in=[user.pk]))
```
Here are some that are safe:
```python
ReviewRequest.objects.filter(submitter=user)
ReviewRequest.objects.filter(target_groups__in=[1]) # Only one result
ReviewRequest.objects.filter(
Exists(
ReviewRequest.target_groups.through.objects
.filter(group_id__in=[3])
) |
Exists(
ReviewRequest.target_people.through.objects
.filter(user_id__in=[user.pk])
)
)
```