On Wed, February 22, 2006 4:52 pm, CodeHeads wrote:
>
> I have a full index index on a table and on of the fields is a number
> field (IP Address). Can MySQL search for numbers??
>

I'm potentially introducing confusion here, because I've never actually
_used_ MySQL, but can't you do one of the following things:

a)Store the number as a string with guaranteed uniqueness, then search by
a string (which I think MySQL will do).  In the case of an IP address, to
make the (IP) -> (STRING) mapping have no collisions, I think all you need
to do is prepend with zeros to reach length three on each number, i.e.
192.168.0.10 would become "192168000010".

b)Store the IP as a 64-bit integer.

I think MySQL will key on strings, right?

Dave.
-----------------------------------
David T. Ashley ([EMAIL PROTECTED])
Thousand Feet Consulting, LLC


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to