Query with big IN clause
try use &quot;with&quot; clase
with employees as (
--- your employee list in select statement 
--- for example:
select 1 emp_id
union
select 2 
)

select * 
from requests rq
join employees em on (em.emp_id = rq.employee)
where start_date &gt; {start_date} and end_date &lt; {end_date}