List:General Discussion« Previous MessageNext Message »
From:Steve Phillips Date:April 4 2003 3:42am
Subject:MySQL index fun
View as plain text  
Hey People :-)

I have a table for ip data that i need to index to suit the following query

SELECT time,source_ip,bytes FROM data.tb_ipdata_0403 WHERE (time > 
1049108400 AND time < 1051786799) AND (source_ip > 3389268097 AND source_ip 
< 3389268099)

if i created an index on the time column and an index of the source_ip 
column would the query then use these indexes or would i need to change my 
query ?

(I was thinking of an index on source_ip and then dropping all entries for 
the customer ip range into a tmp table and doing the summing on that as the 
table should be a lot smaller)

Steve Phillips
Professional Slacker

MySQL index funSteve Phillips4 Apr
  • Re: MySQL index funDan Nelson4 Apr
    • RE: MySQL index funDan Rossi4 Apr
      • Re: MySQL index funDan Nelson4 Apr