From: Marcus Bointon Date: October 27 2011 1:09pm Subject: Re: Master-Master -> duplicate entry List-Archive: http://lists.mysql.com/replication/2252 Message-Id: <233271C3-5085-4AC2-B8EC-B586778780CF@synchromedia.co.uk> MIME-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 27 Oct 2011, at 14:55, Ricardo wrote: > Currently I have as a a pk, an autoincrement value as int(9) >=20 > I should be able to reach 999.999.999 records, right? >=20 > Placing the autoincrement as 10, I will have 10x less so I will have = 99.999.999 (99 million records).=20 >=20 > Is this correct? >=20 > Since I already have around 125.000.000 records, I guessing = implementing this without clearing some records, will pretty much ruin = everything. >=20 > Any advice? >=20 > I can use an autoincrement of 5 for instance. Guessing having master 1 = with offset of 1 and master 2 with an offset of 2, I feel i will not = have much of a problem here. The number after the field isn't anything to do with its stored size or = value range, just how it's displayed. MySQL uses typical binary ranges = for its numeric types, so an unsigned integer is typically 32 bits, = giving a range of 0 to 4294967295 (about 4 billion). There are other = integer types: tinyint(8 bits) smallint(16 bits), mediumint(24 bits), = int(32 bits), bigint(64 bits), all of which may be signed or unsigned. = PHP only handles signed ints so the biggest value it can handle in = 32-bits is 2147483647, which is the limit you're most likely to hit. = Using a signed integer type for an autoinc field is just a waste of a = bit as you'll never use the negative half of the number range. Signed integers default to int(11) because they can have up to 10 = base-10 digits plus a sign character; unsigned defaults to int(10) = because it doesn't need the extra space for the sign. Both store their = values in 32 bits. Marcus --=20 Marcus Bointon Synchromedia Limited: Creators of http://www.smartmessages.net/ UK info@hand CRM solutions marcus@stripped | http://www.synchromedia.co.uk/