If you're filtering a queryset using values from a different queryset, what is the best way to annotate the "filter" value onto the original queryset?
For example, below I have a simGrants QS that I'm filtering using the simKeys QS. When a match is found, I'd like to append the matching simKeys cosine score to the simGrants object.
The database is fairly large so I'm looking to find the most computationally efficient way to do this.
Simkeys =similarity_matrix.objects.filter(y_axis__in=profiles).filter(cosine_score__gt=0)
simGrants = Grant.objects.filter(indexKey__in=simKeys)