* Julian > MEDIUMINT takes only 8 bytes, but BIGINT takes 20, so the whole DB
No, MEDIUMINT occupies 3 bytes, BIGINT 8 bytes. <URL: http://www.mysql.com/doc/en/Storage_requirements.html > > grows, moreover in Mysql documentation I read about indexes and column > optimization and thay sad: medium int is always better than int - in > context of that article. It is normally better to use the smallest possible datatype, simply to preserve space (disk & ram). > I would like to do as small as possible my db, so select-s to be much > faster using index/key. However I would like to support a large number > of possible rows(to be inserted in respective tables). Then you are in conflict with yourself... ;) You have to choose: a small datatype to preserve space _or_ a wider datatype to allow for bigger values. [...] > > will be inc. with 10000 and one pretty day auto_increment will become > > over than 65535 - limit, but in the table I will have only 10000-15000 > > rows)! > > If I chose another coulumn type for example with 4G limit the size of > > INDEX will become bigger and slower. Yes, but this may not be significant in your case. With this small amount of data (10-15K rows), a SMALLINT key would occupy 20-30K bytes (2 bytes/row), a MEDIUMINT would occupy 30-45K bytes, and a BIGINT would occupy 80-120K bytes. This is not much, the difference between a SMALLINT and a BIGINT key would probably not even be noticeable. A unsigned MEDIUMINT would give you 16777216 possible key values. If you use 10.000 each day, you would hit the ceiling after about 4.5 years. If that is not acceptable, a normal INT (4 bytes) may be a reasonable tradeoff: you would need 1176 years to exhaust all keys, if you use 10.000 each day. A BIGINT would of course be overkill, you would have to write 10.000 keys per _second_ in 60 million years to use all keys... :) -- Roger --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php