List:General Discussion« Previous MessageNext Message »
From:Chris W Date:April 22 2010 3:34pm
Subject:Re: Auto Increment in InnoDB
View as plain text  
Johan De Meersman wrote:
> On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen <carsten@stripped>wrote:
>
>   
>>  Wouldn't that strategy cause problems if one or more rows have been
>> deleted in the meantime? (i.e. sequence numbers 1-4 have been created, row
>> 2 has been deleted - new sequence number would be 4).
>>
>>     
>
> Yeps. I'm none too sharp today, apparently. Max() it is.
>
>   

That may not be an issue in this case.  Since it sounds like he is 
keeping a revision history, I wouldn't be surprised if he plans on not 
allowing the deleting of records, unless of course all of the revision 
history for a given file Cluster/File are deleted.  If that is the case 
the count would work fine.  If that is not the case, max may not work 
either since if the last revision record has been deleted then using max 
will give faulty data as well.  Seems the only way for something like 
this to work is if you keep the full revision history.  Although I 
suppose that if you were to keep say the most recent  X revisions then 
the last revision would always be in the table and max could work where 
count would not always.

Chris W
Thread
Auto Increment in InnoDBAveek Misra22 Apr
  • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
    • Re: Auto Increment in InnoDBAveek Misra22 Apr
      • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
        • Re: Auto Increment in InnoDBAveek Misra22 Apr
          • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
            • Re: Auto Increment in InnoDBAveek Misra22 Apr
              • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
            • Re: Auto Increment in InnoDBCarsten Pedersen22 Apr
              • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
                • Re: Auto Increment in InnoDBChris W22 Apr
                  • Re: Auto Increment in InnoDBJohan De Meersman23 Apr
  • Re: Auto Increment in InnoDBmos22 Apr