First let me state that I agree with everything that Chaos, Larry and Phil said.
But if you insist otherwise ...
There are two reasons for your overall PK. One uniqueness in two tables and two for complete referential integrity.
I'm not sure what exactly the "sequence" supports Auto_increment columns. It seems that there is a system setting to determine the growth by value, but nothing per column.
What would I do in Oracle, just split the same sequence between two tables. Another method would be to set the STEP 2 value to auto_increment and start one at 1 and the other at 2. In any case, you generate unique values ββbetween them.
You can create a third table in which there is nothing but a PK column. This column can also provide Autonumbering if there is no way to create a missed autodial inside a single server. Then, on each of your data tables, you add CRUD triggers. Insertion into any data table first initiates insertion into the pseudo-index table (and returns the identifier for use in the local table). Similarly, deletion from the local table initiates deletion of pseudo indexes from the table. Any table of children that should point to the parent points to this pseudo-index table.
Please note that this should be a trigger for each row and will slow down the work in these tables. But product type tables, as a rule, do not have very high DML speeds. Anyone who complains about "performance impact" is not given the scale.
Please note that this is provided as a valid alternative, not my recommendation as the best way.
source share