Eleinia wrote:No, I was asking about the "post count", which we are talking about in this thread. I was just curious how big the post count could go up to before it overflows.
The post count itself probably isn't stored anywhere, but rather re-calculated on the fly. I don't think there is a limit to the post count itself (like you might see in a video games for various counters), but you could theoretically cause problems in the PHP code that checks the database, if the phpbb devs used a normal integer type during the calculation (which, as you said is usually 32 bits).
- Unsigned 32-bit integers can store up to 4.2 billion
- Signed 32-bit integers can store up to 2.1 billion.
According to the PHP docs, integers which overflow, are automatically converted to the "float" (floating point) type, which would allow the values to go *much* higher (although, with reduced precision after a point).
Another place you could run into integer overflow issues, is in the database side. Most of the time, records have at least one integer field, which automatically goes up by 1 every time a new record is added. So that other records can be linked to the new record (eg: for this new user record, which posts were made by him or her?).
It looks like, in the case of our database, the post id is the mysql data type "mediumint unsigned", which can go up to 16.7 million. If the number of posts reaches that point, we will probably start getting database errors saying something like "integer overflow", and no more posts will be saved. If that were to happen, it would be fixable in a few ways. eg: convert the id field type to an integer type that can support larger values, like "bigint unsigned", which can hold numbers up to 18.4 septillion.
It's incredibly unlikely that we will get 16.7 million posts (this is is a small forum, and probably won't be active for more than a few years). But, in the event that it was possible (if this was a larger place like GameFAQs, for instance), we'd first run into issues like:
(in this order):
- ram (used by mysql while running queries)
- cpu (used by mysql to run queries to fetch data)]
- disk i/o speed (needed by mysql, otherwise it takes a long time)
- harddrive space (to store all the posts)