I have thousands of records I need to update, but they are non-sequential, and follow no pattern. Something like this:
161,177,178,180,181, [...] 9515,9516,9519,9521,9522
Let's say I want to do something like this:
UPDATE mytable
SET status="3"
WHERE indexID = 9161;
then repeat for each of the above. Is it OK to use a massive IN?
UPDATE mytable
SET status="3"
WHERE indexID IN (161,177,178,180,181, [...] 9515,9516,9519,9521,9522)
I'm sure the above would work with "several"... but with thousands? Currently 10k is about my upper limit, but that could expand. I don't think 100k would ever be a reality.
I tried it on a set of roughly 6000 and it worked (took about 30 seconds I think - I didn't time it) so this isn't really a problem for me now, but could be down the road.
Is there a better way?