I am performing a query that is or-ing a bunch Q's together and it seems to be taking a lot of time. Here is some psuedo code
query_params = []
for i in range(80): #there are about 80ish Q objects being created
query_params.append(Q(filter_stuff))
Then I or them all together
query_params = reduce(or_, query_params)
And when I execute the query
query = list(MyModel.objects.filter(query_params))
It hangs for a LONG time. I know this is a pretty general question and it's hard to given a diagnostic without an intimate understanding of the data structure (which would be difficult to give here). But I'm just curious if there is an inherent performance impact of or-ing Q
objects in a django query