It seems that when you add the 20th element, the optimizer generates a different execution plan. Implementation plans are based on statistics. Search criteria affect expected rows of results. When you add more items to the criteria list, the expected returned rows change and the optimizer can generate a new execution plan.
Check the execution plan (CTRL-L) of both queries. This is the only way to find out why it takes longer when you have more than 20 items in the list.
Before considering execution plans, update your table statistics:
UPDATE STATISTICS records
if you can wait
UPDATE STATISTICS records WITH FULLSCAN
The second will take longer, but you will have more consistent statistics.
source share