I have different tables that need to share a pool of primary keys.
E.g. table A has primary keys 0 to 9, table B has primary keys 10 to 19.
Is there a way to tell mysql where to draw the primary key from? Like a stored procedure? It would be enough to execute a script that knows about the distribution of the buckets.
A naive approach would be to set the primary key within each insert statement. That PK is drawn from that pool. Actually, this would need to be implemented within each application (like php or java) that inserts into that DB which I want to avoid.