> ###query the last time where ip='172.017.011.253'
> mysql> select max(THE_TIME) from COLL_DATA where
IP_ADDR='172.017.011.253';
> +---------------------+
> | max(THE_TIME) |
> +---------------------+
> | 2001-11-26 14:35:18 |
> +---------------------+
> 1 row in set (6.77 sec)
> ~~~~~~~~It's too slowly

Try storing the IP address as a numeric type, possibly decimal(10), and
using the functions INET_NTOA and INET_ATON to convert from the address back
and forth between dotted hexadecimal and decimal.  This will help because
instead of searching for MySQL having to search a varchar(50) field, it can
search a numeric field, which of course is faster.

Ryan


---------------------------------------------------------------------
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 <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to