Open
Description
We have fallen into the ease of if statements in python list comprehension. This is negatively affecting our query efficiency. We need to move to more complex queries (using table joins, etc.) instead of falling into the [a for a in query_a if query_b]
alternative.
Making a query for every result in the first query isn't necessary and these operations can be made far more efficient.