2006/4/13, Puiu Hrenciuc <[EMAIL PROTECTED]>: > Hi, > > I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic > data : > > record_time datetime - time when recording was added > ip char(15) - ip that generated the traffic > type tinyint(3) - traffic type ( 1 - local, 2 - internet ) > inbound int(10) - in bytes > outbound int(10) - out bytes > > Records are inserted each 5 minutes through a cron script. > Currently there are 3,330,367 rows. > > Primary index is defined on ( ip, type, record_time ), columns in that > order. > Also there is an index defined only on record_time
You don't need a char(15) to store the IP. an unsigned integer should be enough. there is INET_ATON and INET_NTOA to do the convertion. http://dev.mysql.com/doc/refman/4.1/en/miscellaneous-functions.html You'll save 11 bytes ! index will be smaller, and it'll give you a better response time I think. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]