RE: Fastest way to log IP's

2006-02-07 Thread Daevid Vincent
I work at a security company, and we store many thousands of IPs in mySQL for networks as large as /16. Use INTEGERS. It's much more efficient. It's easier to use. And it allows your sorting (ORDER BY) to be in the proper order. If you stored as characters you'd eroneously get: 192.168.1.1 192

Re: Fastest way to log IP's

2006-02-02 Thread Jay Paulson
> I'm logging IP addresses and also searching for existing ones. Does > anyone happen to know which is more resource intensive: storing the > IP's as integers using INET_NTOA() and INET_ATON() to convert them at > each query; or simply storing the IP as a varchar? In each case the > IP field would

Re: Fastest way to log IP's

2006-02-02 Thread Asad Habib
Storing the IP addresses as integers requires less memory but incurrs the cost of a call to these functions for every IP address. If you are going to use these addresses in string comparisons it's best to store them as varchars. - Asad On Thu, 2 Feb 2006, Brian Dunning wrote: I'm logging I

Re: Fastest way to log IP's

2006-02-02 Thread SGreen
Brian Dunning <[EMAIL PROTECTED]> wrote on 02/02/2006 11:21:25 AM: > I'm logging IP addresses and also searching for existing ones. Does > anyone happen to know which is more resource intensive: storing the > IP's as integers using INET_NTOA() and INET_ATON() to convert them at > each query; or