so basically here's what i want to do: i have an account table, i have a list of acct_id: (3, 24, 515, 6326, 17), assuming i have about 100,000 accounts in the table, what's the most effective way to delete all the other rows besides the one with the account_id in my given list?
i came up with something like:
delete from account where acct_id is not in (3, 24, 515, 6326, 17);
i heard this query is slow because it's recursive or something. consider the number of rows i have, that would be VERY SLOW. what's a better way to do this?