List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 12 2003 5:22pm
Subject:RE: automatically incrementing an int value
View as plain text  
At 11:45 -0500 3/12/03, Keith C. Ivey wrote:
>On 12 Mar 2003, at 10:22, Douglas B. Jones wrote:
>
>>  INSERT INTO virus VALUES (91207,'VBS/Kakworm');
>>  INSERT INTO virus VALUES (117623,'VBS/Redlof-A');
>>
>>  As you can see, the numbers (n field) are way to high? Is this a bug
>>  in mysql or n the sql?
>
>It's far more likely to be a bug in your application or your
>understanding.  What makes you think the numbers are too high?  You
>said you did 122,111 REPLACE queries, so the last one should have had
>an autoincrement value of at least 122,111.  Maybe you want to use
>INSERT IGNORE instead of REPLACE, so that you're keeping the first ID
>you create instead of the last?

That will keep the original AUTO_INCREMENT value.  Unfortunately, it
will still generate (and throw away) a new AUTO_INCREMENT value each
time.  If one of the goals is to minimize number of values generated,
it's better to use just INSERT and ignore the error when the name
value is a duplicate.

>--
>Keith C. Ivey <keith@stripped>
>Tobacco Documents Online
>http://tobaccodocuments.org
>Phone 202-667-6653
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <mysql-thread134549@stripped>
>To unsubscribe, e-mail <mysql-unsubscribe-paul=snake.net@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
automatically incrementing an int valueDouglas B. Jones10 Mar
Re: automatically incrementing an int valueAlec.Cawley10 Mar
  • RE: automatically incrementing an int valueDouglas B. Jones10 Mar
    • RE: automatically incrementing an int valuePaul DuBois10 Mar
      • RE: automatically incrementing an int valueDouglas B. Jones12 Mar
        • RE: automatically incrementing an int valueDouglas B. Jones12 Mar
        • RE: automatically incrementing an int valuePaul DuBois12 Mar
          • RE: automatically incrementing an int valueDouglas B. Jones12 Mar
            • RE: automatically incrementing an int valuePaul DuBois12 Mar
              • Re: automatically incrementing an int valueBenjamin Pflugmann12 Mar
            • Re: automatically incrementing an int valueJoseph Bueno12 Mar
            • RE: automatically incrementing an int valueKeith C. Ivey12 Mar
        • RE: automatically incrementing an int valueKeith C. Ivey12 Mar
          • RE: automatically incrementing an int valueDouglas B. Jones12 Mar
          • RE: automatically incrementing an int valuePaul DuBois12 Mar
RE: automatically incrementing an int valueAlec.Cawley12 Mar
  • RE: automatically incrementing an int valueDouglas B. Jones12 Mar