Question about sequences - how many is too many?
I have a table with a primary key based on a sequence. This table has a column named org_id that defines the organization. I have another sequential numeric column in the table that is unique for each organization. To be brief:
create table messages
(message_id number,
org_id number,
org_message_id number);
(Don't worry about the business need of this second sequence - it is legitimate and/or too much work to change the logic - well too much work to convince the development team to deep dive into code that is already working).
Currently we don't use sequences to populate the org_message_id. What we do is have a serial table that contains the next sequence for each organization, again, briefly: