Skip to:
Content
Pages
Categories
Search
Top
Bottom

database MINOR issue


  • assalychris
    Member

    @assalychris

    hello (again)

    I have noticed the same ‘problem’ with wp: whenever you create a user for testing purposes (his user ID is suppose X) and delete him you obiviously notice by creating another one (again) his NEW user ID is X+1 and so on. I don’t know if I made myself clear BUT how can you fix this issue? Even if there is no automatic solution what do I have to modify in the database by using phpmyadmin so only ACTUAL users have user IDs.

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)

  • assalychris
    Member

    @assalychris

    This question has been answered on irc by livibetter & trentadams thanks guys.

    changing that value could create issues with the database.

    Glad to help ;)

    Trent

    > This question has been answered on irc by livibetter & trentadams thanks guys.

    Why don’t you post it here, where other people may find the answer when they’re looking for it?


    livibetter
    Member

    @livibetter

    Here is my explanation:

    The question is should we reuse deleted ID?

    1. Says we have ID from 1 to 10. ID 5 is just deleted and a new user just registered. How does the program know which ID should be assigned to this new user? If this program reuse ID, then it have to go through the entire data, just for find out which ID is available. Or add another table for storing those deleted IDs? Reusing ID makes performance issue.

    2. If this new users is assigned ID 5, then the admin suddenly find out he deleted wrong user, that should be another user. And if this program can partially restore data, can this program just do that? It can’t. ID 5 has been assigned to a new user, if you want to restore that deleted user, you may need to assign a new ID to that deleted user.

    3. Now, think about a products database. You deleted a product, and inserted another one with same ID (assuming 5). If there is another program can order products using IDs only, it says it wants ID 5. But it actually meant old ID 5, not new ID 5. If you don’t reuse ID, then the transaction can’t be done.


    chrishajer
    Participant

    @chrishajer

    Why does the ID matter at all? Does it matter that it’s autoincremented and there are ‘wasted’ IDs?

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.