To my way of thinking, especially with regard to DELETE, this is an illustration of why “obvious simplicity always wins.” I do not want a “clever” way to delete 10,000 somethings. Instead, I want to write logic that, say, queries for the keys to be deleted, and then, in a transaction, deletes those keys. (Possibly a sensibly-sized group at a time, blah, blah, blah...) The resulting code may or may not be “efficient,” in some people’s minds, but (a) it is certainly efficient enough, and (b) it makes it easy to dump out a list of the keys that you think you’re going to delete while you are debugging the thing, without actually doing it (yet). My main objective in writing code like this is to make damm sure that I am not about to shoot off my own foot; not to shoot it off a little bit faster.
As far as the “appropriateness” of this post goes, well, yes, it is not quite “on-topic,” but then again, most of us do use MySQL quite-a-bit in connection with Perl, so IMHO it is “tangentally related” enough not to warrant “consideration” by the mods.