Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2014
    Location
    coimbatore
    Posts
    5

    Unanswered: fluctuations in generation of primary key auto increment value.

    Dear friends,

    I was just try to Insert some columns in mysql table.

    Table consists primary key with auto increment (seed value=1).

    So Initially table is :
    ---------------------------
    id name
    --------------------------
    1 williams
    2 andrew
    --------------------------

    But After i inserted,the table is :

    -------------------------------
    id name
    -------------------------------
    1 williams
    2 andrew
    4 methew
    5 ram
    -----------------------------
    So i am not aware why some fluctuations happening in auto Increment value.
    Why the id 3 was ignored.so please clarify my doubt.

    Thanks.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    do not rely on an autoincrement number for any meaning OUTSIDE the system itself. so if you require (as opposed to want) a contiguous set of numbers then create your own function to do that

    AS to wht caused this...
    the most likely reasons:-
    that you started to insert a row and it failed for some reason or you cancelled the insert
    you've deleted the missing row
    it could be the function within MySQL is doing something else for performance reasons

    so to me unless you think rows are being deleted from the table by someone/something then what you are experiencing is acceptable behaviour. the auto generated value is doing its job ensuring that there is a unique value to refer to each row. nothing more, nothing less
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •