From: Daevid Vincent Date: June 14 2006 7:48pm Subject: RE: Reset (or Defrag) the AUTO_INCREMENT columns List-Archive: http://lists.mysql.com/mysql/198938 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I keep this little chart tacked to my wall: # BIGINT UNSIGNED =3D 8 Byte =3D FFFFFFFFFFFFFFFF =3D = 18446744073709551615 # INT UNSIGNED =3D 4 Byte =3D FFFFFFFF =3D 4294967295 # MEDIUMINT UNSIGNED =3D 3 Byte =3D FFFFFF =3D 16777215 # SMALLINT UNSIGNED =3D 2 Byte =3D FFFF =3D 65535 # TINYINT UNSIGNED =3D 1 Byte =3D FF =3D 255 # BIGINT SIGNED =3D -9223372036854775808 to 9223372036854775807 =20 # INT SIGNED =3D -2147483648 to 2147483647=20 # MEDIUMINT SIGNED =3D -8388608 to 8388607 =20 # SMALLINT SIGNED =3D -32768 to 32767=20 # TINYINT SIGNED =3D -128 to 127 # TINYTEXT =3D 255 # TEXT =3D 65535 # MEDIUMTEXT =3D 16777215 # LONGTEXT =3D 4294967295 D=C6VID =20 > -----Original Message----- > From: Daniel Kasak [mailto:dkasak@stripped]=20 > Sent: Tuesday, June 13, 2006 9:52 PM > To: wolverine my; mysql@stripped > Subject: Re: Reset (or Defrag) the AUTO_INCREMENT columns >=20 > wolverine my wrote: >=20 > > Yes, I agree on what you have described. > > > > However, what should we do when the value is reaching the=20 > maximum? To > > alter the data type to a bigger one? >=20 > Yes - convert the data type to a larger one. >=20 > If you've got a mediumint, for example, you can convert it to an > unsigned mediumint. The 'unsigned' bit means that the field=20 > won't store > negative values - this gives you twice the positive numbers you can > store. Otherwise if you're already using an unsigned data type, then > just go up to the next data type ( eg mediumint to int, or int to > bigint, etc ).