Hi everyone,
I am having an issue with the queryset's __in lookup. The story is that we need to filter within a very long list.
E.g.
users = User.objects.filter(id__in=long_list_uids).filter(**logic_conditions).
Since the long_list_uids is really long (Around 20k items), it will be ineffective to pass the list to the DB layer.
And there is no way to get the list directly from DB.
Put the logic aside, is there any way to improve this?
I am thinking about inheriting the QuerySet class to make to store multiple smaller queryset, but still acts like a normal Queryset. Is this possible?
Thanks in advance,