'; flush(); //Zeit Messen: INT mit Index $ip=rand(150,244).'.'.rand(0,254).'.'.rand(0,254).'.'.rand(0,254); $t2=microtime(true); for ($x=1;$x<500;$x++) { mysql_query('select * from ip where ip_int_index="'.(ip2long($ip)+$x).'" LIMIT 1'); } $t2=microtime(true)-$t2; echo 'INT (LONG) mit Index :'.$t2.' s
'; flush(); //Zeit Messen: INT ohne Index $ip=rand(150,244).'.'.rand(0,254).'.'.rand(0,254).'.'.rand(0,254); $t1=microtime(true); for ($x=1;$x<500;$x++) { mysql_query('select * from ip where ip_int="'.(ip2long($ip)+$x).'" LIMIT 1'); } $t1=microtime(true)-$t1; echo 'INT (LONG) ohne Index :'.$t1.' s
'; flush(); //Zeit Messen: VarChar ohne Index $ip=rand(150,244).'.'.rand(0,254).'.'.rand(0,254).'.'.rand(0,254); $t3=microtime(true); for ($x=1;$x<500;$x++) { mysql_query('select * from ip where ip_varchar="'.long2ip(ip2long($ip)+$x).'" LIMIT 1'); } $t3=microtime(true)-$t3; echo 'VarChar (15) ohne Index :'.$t3.' s
'; flush(); //Zeit Messen: VarChar mit Index $ip=rand(150,244).'.'.rand(0,254).'.'.rand(0,254).'.'.rand(0,254); $t4=microtime(true); for ($x=1;$x<500;$x++) { mysql_query('select * from ip where ip_varchar_index="'.long2ip(ip2long($ip)+$x).'" LIMIT 1'); } $t4=microtime(true)-$t4; echo 'VarChar (15) mit Index :'.$t4.' s
'; flush(); //Zeit Messen: Text ohne Index $ip=rand(150,244).'.'.rand(0,254).'.'.rand(0,254).'.'.rand(0,254); $t5=microtime(true); for ($x=1;$x<500;$x++) { mysql_query('select * from ip where ip_text="'.long2ip(ip2long($ip)+$x).'" LIMIT 1'); } $t5=microtime(true)-$t5; echo 'Text ohne Index :'.$t5.' s
'; flush(); mysql_query('DROP TABLE ip'); ?>