Increase performance of "in" filter

I use a standard set of users in an array, that I want to get metrics for in multiple queries.
I’m using an “in” filter for this. The value for “in” is the user array. The length of the array is at least 40000. This is taking ~30 seconds to give results, for just a single query. And I need to execute multiple queries to plot multiple graphs.

I’m using the standard configuration from conf-quickstart. Is there any way to reduce the query execution time?

40k entries in an InFilter is probably too heavy, do those users have any shared properties? E.g., all the users belong to some shared organization.

If so, perhaps you could add a field representing the shared property during ingestion that you could filter on later.