[wp-hackers] Storing IP's in the DB

Dougal Campbell dougal at gunters.org
Thu Apr 30 14:15:50 GMT 2009

Ozh wrote:
> Hey peeps
> I've read that it's better & faster to store IP as integers instead of
> strings, and then using INET_ATON / INET_NTOA functions to convert
> (the argument being that MySQL is faster with numbers than with
> strings)
> Any reason why WP is not doing this?

The only place that Core stores IP numbers is for comments, right? Do we 
ever do any indexing by IP number? Even if so, it's not a very common 
operation. It's probably mostly a case of "If it ain't broke, don't fix 
it." There's just not much to gain by changing that, except for the rare 
case of sites that spend a lot of time reviewing zillions of spam 
comments and grouping/sorting them by IP.

Dougal Campbell <dougal at gunters.org>

More information about the wp-hackers mailing list