Jump to content

Simple q: Confusion about exact datatype meaning


NoUser2U
 Share

Recommended Posts

Let's say i have a table:CREATE TABLE users (id INT UNSIGNED AUTO_INCREMENT)Due to the UNSIGNED option of the INT-datatype, the range of INT is 0 - 4294967295 (source: mysql manual).Now what i am confused about is, is that range the total number of rows the users-table can hold, or is '4294967295' the highest value the 'integer' column can hold?For example, will my users-table 'run out of space' when the table contains exactly 4294967295 rows? like so:-----id (this table contains 4294967295 rows)-----0123....4294967295-----Or will it 'run out' when there is a HUGE gap between 0 and 4294967295, like:-----id (this table contains 5 rows)-----01234294967295-----I'm sure this is a very simple question, but i've been looking the internet for a long time but found no question to this simple thing unfortunately :).Much thank in advance!

Edited by Donotknow
Link to comment
Share on other sites

Ooh i get it, thank you very much.So in theory, the number of rows a table may contain is infinite? For example:CREATE TABLE users (firstname CHAR(5))Since this table has no columns consisting of any numeric datatypes, it may practically contain unlimited rows?

Link to comment
Share on other sites

Ooh i get it, thank you very much.So in theory, the number of rows a table may contain is infinite? For example:CREATE TABLE users (firstname CHAR(5))Since this table has no columns consisting of any numeric datatypes, it may practically contain unlimited rows?
your table can expand as far it can grow. if you need more range in usrid column you can make it bigint Edited by birbal
Link to comment
Share on other sites

Tables can theoretically contain indefinite numbers of rows, however practically there are multiple engine, storage format and other limitations. For example, since MyISAM (a popular storage scheme for tables in MySQL) uses 32-bit pointers for the row locations, you can only store 4GB of data (sort of) before the table is "full".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...