My application needs to change a value in a table if it is not in a very large set (20,000 items) that come in through an XML API. Obviously, it would be easy to create a solution that would be very slow.
I'd like to know how you might recommend doing this? I'm thinking adding the unique IDs of the items in the XML to a temporary table, then executing a single query:
UPDATE item SET status = "deleted" WHERE id NOT IN (SELECT id FROM keep_items);
What do you think?