I have a query that runs fairly fast under normal circumstances. But it is running very slow (at least 20 minutes in SSMS) due to how many values are in the filter. 

Here's the generic version of it, and you can see that one part is filtering by over 8,000 values, making it run slow. 

```
SELECT DISTINCT 
    column 
FROM 
    table_a a 
JOIN 
    table_b b ON (a.KEY = b.KEY)
WHERE 
    a.date BETWEEN @Start and @End
    AND b.ID IN (... over 8,000 values)
    AND b.place IN ( ... 20 values)
ORDER BY 
    a.column ASC

```

It's to the point where it's too slow to use in the production application. 

Does anyone know how to fix this, or optimize the query?