sql - What does MySQL do when auto incrementing IDs overflow? -
I have a DJ ango app that uses MySQL as a database backend. It's been running for a few days, and I'm already up to ID 5000 in some tables
I worry about what will happen when the datatype is filled.
Has the auto indentament been asked to start at some point? My data is very unstable, so when I overflow the ID, then there is no possible way that ID 0, or anywhere near it, is still in use.
Whether you are using an unsigned integer and depending on who you are using MySQL Running the same version, you run a random (or worse) row just to get the negative negative values for the primary key and throw an error.
He said, you can easily change the size / type in MySQL before using an ALTER command of the integer to prevent it from happening, the INT used as the primary key The "standard" size is INT (11), but most of the DB applications should not be nearly as large, try MEDIUMINT.
MEDIUMINT - The signed border is 8388607 with 8388608. Compared to unsigned boundary 0 to 16777215
....
INT or INTEGER - Signed range is 2147483647 with 2147483648. Unsigned range 0 to 4294967290
There are also beginnings, but honestly, if you have a table with> 2 billion rows, you may have to compare your data types. Too many scalability issues will be found :)
Comments
Post a Comment