I want to query data for a set of IDs from a table. The size of the set might become large in some cases, for around 1000 to 4000 IDs.
Ex1: SELECT x FROM table WHERE id IN (ID1, ID2, ..., ID4000)
Ex2: SELECT x FROM table WHERE id = ID1 OR id = ID2 ... OR id =ID4000
1- Whats the limitation of including such a set in the query's WHERE
clause (OR
or IN
statement)?
2- Is there a drawback or is that size considered large?
3- Is splitting the query to smaller portions the alternative?