I am working on re-factoring a database. There is a process that inserts a row in one of two tables, and the id needs to be unique across the two tables.
Currently the application layer iterates through a predetermined array of keys.
I am considering a
Sequence to generate the next id, as apposed to a
SELECT MAX(id) + 1.
Are there any performance gains to be realized from using a Sequence?