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
https://forums.phpfreaks.com/topic/249387-auto_increment-backwards/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.