I use this pattern in mysql. One row, and one update query gets you a block of IDs. Don't want to attempt to write it out here without looking, but the trick is using the last insert id in the query (and on the result).
It's one query, so shouldn't require a plugin I hope.
It's one query, so shouldn't require a plugin I hope.