-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Actually, I think he was asking if the sized used by the storage engine
would change if you used for example int(2) as apposed to int(10). My guess
is it would not, but that's just a guess.
Aaron Cannon
- --
Skype: cannona
MSN/Windows Messenger: [EMAIL PROTECTED] (don't send email to the hotmail
address.)
- ----- Original Message -----
From: "Dan Buettner" <[EMAIL PROTECTED]>
To: "Olaf Stein" <[EMAIL PROTECTED]>
Cc: "MySql" <mysql@lists.mysql.com>
Sent: Friday, January 05, 2007 8:45 AM
Subject: Re: Data types and space needs
Olaf, not a silly question at all. You can indeed save space by using
different forms of integer.
See
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html
and
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
From that second page:
Storage Requirements for Numeric Types
Data Type Storage Required
TINYINT 1 byte
SMALLINT 2 bytes
MEDIUMINT 3 bytes
INT, INTEGER 4 bytes
BIGINT 8 bytes
You may also be able to use UNSIGNED to extend the range of a column,
if you don't need to store negative values.
HTH,
Dan
On 1/5/07, Olaf Stein <[EMAIL PROTECTED]> wrote:
Hi All,
I have somewhat of a silly question.
If I define a column as int it needs 4 bytes.
Do I gain anything space wise if I restrict the length to e.g. 10,
int(10),
or is this only a logical restriction?
Thanks
Olaf
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959
Comment: Key available from all major key servers.
iD8DBQFFnnnGI7J99hVZuJcRAkstAJsEw8S1ZxnEpL+oXvpDsTfKx3C34QCgpnNT
hd379sQHorwV3eV9NcYeq0E=
=WAXX
-----END PGP SIGNATURE-----
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]