In fact, if you are storing the ids in the set, then you dont actually need to test each id, instead iterate over the ids in the set and set the flag on each row manually, which is an O(1) operation per id
And I think "marked" is a better search term than "search_mark"