Jump to content

Auto_increment backwards


soltek

Recommended Posts

Hey there, I just noticed that my auto_increment of the new entries is... well, backwards.

 

Like:

ID

1

2

3

4

17

16

15

14

13

12

[...]

 

You know what I mean? If I add another entry, whose ID value would be 18, it would be added not to the end of the table, but after the forth, instead.

 

Do you know how to fix it? I think it may harm the performance.

 

Cheers!

Link to comment
Share on other sites

There is no "order" to records.  That simply means you've deleted some along the way.

 

This isn't a real problem -- don't pretend that it is.

 

There's an ORDER BY clause to deal with ordering.

 

But you should never be relying on the auto-increment for ordering anyway, since it's a magic number that you don't control.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.