List:Replication« Previous MessageNext Message »
From:Marcus Bointon Date:October 27 2011 1:09pm
Subject:Re: Master-Master -> duplicate entry
View as plain text  
On 27 Oct 2011, at 14:55, Ricardo wrote:

> Currently I have as a a pk, an autoincrement value as int(9)
> 
> I should be able to reach 999.999.999 records, right?
> 
> Placing the autoincrement as 10, I will have 10x less so I will have 99.999.999 (99
> million records). 
> 
> Is this correct?
> 
> Since I already have around 125.000.000 records, I guessing implementing this without
> clearing some records, will pretty much ruin everything.
> 
> Any advice?
> 
> 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
-- 
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
UK info@hand CRM solutions
marcus@stripped | http://www.synchromedia.co.uk/



Thread
Master-Master -> duplicate entryRicardo Freitas26 Oct
  • Re: Master-Master -> duplicate entrynavid@navid.it26 Oct
    • Re: Master-Master -> duplicate entryRicardo26 Oct
  • Re: Master-Master -> duplicate entryRick James27 Oct
    • Re: Master-Master -> duplicate entryRicardo27 Oct
      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
        • Re: Master-Master -> duplicate entryJohan De Meersman27 Oct
          • Re: Master-Master -> duplicate entryRicardo27 Oct
          • Re: Master-Master -> duplicate entryRicardo27 Oct
          • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
            • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
              • Re: Master-Master -> duplicate entrynavid@navid.it27 Oct
              • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
                  • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                    • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
                    • Re: Master-Master -> duplicate entryRicardo27 Oct
                      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                        • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
                          • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                            • Re: Master-Master -> duplicate entry (UUID lecture)Rick James27 Oct
            • Re: Master-Master -> duplicate entryJohan De Meersman28 Oct
        • Re: Master-Master -> duplicate entryRicardo27 Oct
  • Re: Master-Master -> duplicate entrylist27 Oct
    • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
        • Re: Master-Master -> duplicate entryMySQL)27 Oct
    • Re: Master-Master -> duplicate entryRick James27 Oct
      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
        • Re: Master-Master -> duplicate entryRick James27 Oct
          • Re: Master-Master -> duplicate entryJohan De Meersman28 Oct
            • Re: Master-Master -> duplicate entryRick James28 Oct
              • Re: Master-Master -> duplicate entryMats Kindahl31 Oct
      • Re: Master-Master -> duplicate entrylist27 Oct