List:Cluster« Previous MessageNext Message »
From:pekka Date:November 11 2005 8:50pm
Subject:Re: Best Fieldtype to store IP address...
View as plain text  
> varchar(16)  ?  because 16 is the max chars of an ip address...
> char(16) ?
> text(16)

Assuming you want it as text for easy searches, char(16).
In 5.0 varchar(16) just uses unnecessary extra 4 bytes.
Even in 5.1 (which has true varchar) I'd use char(16).

text(16) is a blob and uses 8+256 bytes in 5.0.

-- 
Pekka Nousiainen, Software Engineer
MySQL AB, www.mysql.com
pekka@stripped +46 (0) 73 068 4978
Thread
Best Fieldtype to store IP address...Cory @ SkyVantage11 Nov
  • Re: Best Fieldtype to store IP address...Evan Borgstrom11 Nov
    • Re: Best Fieldtype to store IP address...Tim Schuh11 Nov
    • Re: Best Fieldtype to store IP address...Michael Stassen11 Nov
  • Re: Best Fieldtype to store IP address...pekka11 Nov