MyBB Community Forums

Full Version: Delete user - Decrease UID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When the admin delete an user the UID not decrease... Big Grin
Sorry for bad english Rolleyes
There isn't any need to decrease the uid.
MyBB is perfect!
When you delete a user, the fact that the uid keeps counting doesn't look too good if you mass-deleted spambot accounts.
This is not how DBMS systems work. The auto increment fields will always go up, and never back down. This is common across all database systems, not just MySQL.

There are many reasons for this, including:
1) Speed - a delete simply removes the entry from the table. If IDs had to go down, the DBMS system would have to keep refreshing potentially thousands or millions of rows each time.
2) Consistency - for example, if something linked to a UID which no longer exists, it simply won't exist any more. An ID is meant to be unique, not something that's overwritten. For example, if we have a user with UID=10, who got deleted. In future, if someone tried to view the profile with UID=10, they'll see that the user doesn't exist anymore, rather than get some random other user.
Reference URL's