In MySQL the OPTIMIZE TABLE instruction allows the re-use of old values from the AUTO_INCREMENTED fields.
e.g.
| ID | datablob |
| 1 | etc etc |
| 2 | etc etc |
| 3 | etc etc |
| 4 | etc etc |
| 5 | etc etc |
If I delete records 1 - 3 and then insert a new record, it's still inserted as record 6.
| ID | datablob |
| 4 | etc etc |
| 5 | etc etc |
| 6 | etc etc |
OPTIMIZE the table and insert a new record and it'll insert in position 1
| ID | datablob |
| 1 | etc etc |
| 4 | etc etc |
| 5 | etc etc |
| 6 | etc etc |
This is something to do with deleted records still existing in linked lists or somesuch.
/Mike