ngreenwood6 Posted January 1, 2012 Share Posted January 1, 2012 I am trying to find out what the maximum number of entries in a mysql database would be. I read online at multiple sources saying that there is no limit on the size of the information or the number of entries in the database. However, that is kind of confusing to me as integer fields obviously have a maximum number that they can store. For example in the mysql documentation it states that the maximum value for an unsigned bigint field is 18446744073709551615. In most cases you will have an auto-increment field with an int or bigint type. So wouldnt the maximum number of entries be this value since eventually you could hit that number. If so then what would you do at that point, would you have to delete some data from the table or split the table into now two tables and start the indexes over. I just want some clarification on what you would do if you were say facebook/twitter/google and stored that amount of information and could potentially reach that number. Any help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/ Share on other sites More sharing options...
AyKay47 Posted January 1, 2012 Share Posted January 1, 2012 They have many servers for there information. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303101 Share on other sites More sharing options...
ngreenwood6 Posted January 1, 2012 Author Share Posted January 1, 2012 I dont think that really answers my question. I understand the replication process of storing it across multiple servers so that access to the data is faster but it still uses the same id's in all of those tables so the id would still hit the max number at some point. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303105 Share on other sites More sharing options...
Pikachu2000 Posted January 1, 2012 Share Posted January 1, 2012 At 1000 table entries per second, it would take over 584 million years to reach that value. $secs_per_year = 31556926; $entries_per_sec = 1000; $entries_per_year = $secs_per_year * $entries_per_sec; $max =18446744073709551615; $yrs = $max / $entries_per_year; echo $yrs; Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303107 Share on other sites More sharing options...
floridaflatlander Posted January 1, 2012 Share Posted January 1, 2012 You may have answered your own question, 18,446,744,073,709,551,615 is a big big number. Also I would think facebook and the like would or could have users spread over many tables if needed. Also I would think that all the other tables come into play to keep this auto-increment way down below the maximum number. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303109 Share on other sites More sharing options...
AyKay47 Posted January 1, 2012 Share Posted January 1, 2012 Bottom line, don't worry, you will never reach that amount. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303111 Share on other sites More sharing options...
ngreenwood6 Posted January 1, 2012 Author Share Posted January 1, 2012 Thanks for the response Pikachu2000. Never thought about doing a calculation to see how long it would take to reach that value. That pretty much eliminates that from being a problem. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303114 Share on other sites More sharing options...
fenway Posted January 1, 2012 Share Posted January 1, 2012 INT UNSIGNED is 4 billion -- that's enough for most. Quote Link to comment https://forums.phpfreaks.com/topic/254168-total-storage-size/#findComment-1303133 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.