FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » Database discussions » Holes in MYSQL Databases?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Holes in MYSQL Databases? [message #162780 is a reply to message #162221] Thu, 15 July 2010 11:16 Go to previous messageGo to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma:
Senior Member
The tables are auto incremental, which means that when you create a new user, that user gets the id after the last one created:

1
2
3
4
5

If you delete the user with userid 3, your table will looks like this
1
2
4
5

and when you create a new user, that user will have id 6
That is the way it HAS to be and any other design will fail horribly, because if you create a new user in "slot 3" all former references to the old user will appear in the new user, etc.

So yes, there will be "holes" but they are not harmful in any way shape or form. The only problem would occur if the "userid" field in your database is just a smallint which can only hold up to 32767 different IDs.

However, since this is 2010, noone uses tinyints in a database anymore, we use regular INT which can hold 2,147,483,647 different IDs

If the need should arise, we just increase that to a bigint which holds 9,223,372,036,854,775,807, but I doubt that you will have 2 billion posts anytime soon!


[Message index]
 
Read Message icon6.gif
Read Message
Read Message
Previous Topic: mssql 2012
Next Topic: slave database mysql
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 22 23:52:11 GMT 2024

Total time taken to generate the page: 0.04859 seconds