Given that the restriction table has 10k items, the first question is how many orders to you expect to need to handle.
If this number is relatively small, then just run each item and find if there are any lines that match what you need.
However, if this number very large, it will make sense to do some preprocessing beforehand and convert the restriction table into some data structure that makes checking the items easier.
The first data structure that comes to (my) mind is a nested object that hold one of the columns as a property.
Then those hold more nested object with another column as property.
Essentially this would allow each line to check a number of properties in an object rather than finding a line in an array of 10k items.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…