Posted by Oli Filth on 02/04/06 05:23
cosmoKen said the following on 03/02/2006 17:06:
> Pete seems to have a particular data type of IP : "The IP is in
> something called a "inet_aton" format"
>
> I agree with you, a classic IP is a VARCHAR(15)
Complete waste of space - an IP is not a VARCHAR(15) - that's just a
human-readable format. VARCHAR(15) is 16 bytes of space (for something
of the form XXX.XXX.XXX.XXX), whereas in reality an IPv4 address is just
32 bits - 4 bytes, if you will. So a MySQL UNSIGNED INT type is
appropriate if you are concerned about efficient storage.
Conversion in and out of this format is trivial.
--
Oli
Navigation:
[Reply to this message]
|