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
Switch to threaded view of this topic Create a new topic Submit Reply
icon6.gif  Holes in MYSQL Databases? [message #162221] Fri, 09 April 2010 04:17 Go to next message
The Witcher is currently offline  The Witcher   United States
Messages: 675
Registered: May 2009
Location: USA
Karma: 3
Senior Member
Had a long discussion with a young man today who explained quite emphatically that by deleting posts and or users (even move/split and merge operations) in a forum (any forum), left "holes" in the database which would eventually make the system unstable and crash.

Off hand I am quite dubious about his claim, primarily since he did not seem able to even match my own meager knowledge about MYSQL; though I have heard such claims before I have never placed much faith in them.

As I understand it MYSQL is not all that much different than any other database in that it has tables, fields, cells, columns and rows in which data is stored, retrieved and or manipulated.

And as I understand it, running Forum Consistency, Rebuild Search Index, and Compact Messages prevents the Database from being adversely affected by the above actins!

Could someone please clarify this for me?


"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Holes in MYSQL Databases? [message #162780 is a reply to message #162221] Thu, 15 July 2010 11:16 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
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!


Re: Holes in MYSQL Databases? [message #169345 is a reply to message #162780] Sat, 28 September 2013 08:38 Go to previous message
charleshbrenner is currently offline  charleshbrenner
Messages: 1
Registered: September 2013
Karma: 0
Junior Member
Thanks for the details. I like the post. Smile
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: mssql 2012
Next Topic: slave database mysql
Goto Forum:
  

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

Current Time: Thu Nov 21 08:38:29 GMT 2024

Total time taken to generate the page: 0.04726 seconds