jeromepelletier
09-04-2006, 06:26 PM
for some reason, this isnt working too well.
Array ( [0] => 1 [id] => 1 [1] => SIMPLE [select_type] => SIMPLE [2] => chat [table] => chat [3] => range [type] => range [4] => reciever,type,postedby [possible_keys] => reciever,type,postedby [5] => type [key] => type [6] => 255 [key_len] => 255 [7] => [ref] => [8] => 5552 [rows] => 5552 [9] => Using where; Using filesort [Extra] => Using where; Using filesort )
is what im getting when i explain my query, it consist of a couple or's and and's
$mychat="EXPLAIN SELECT * from chat where type='chest'";
$mychat .=" OR type='auction' AND postedby='Admin'";
$mychat .=" OR type='mutes' AND reciever='$player'";
$mychat .=" OR type='tomutes' AND reciever='$player'";
$mychat .=" order by ID DESC LIMIT 50";
$mychat2=mysql_query($mychat) or die("Chat Error: 4052");
$mychat3=mysql_fetch_array($mychat2);
I have type and reciever and ID and postedby all indexed, theres 20,000 rows and its searching 5000 so its semi working...but i need to get that down even more...any ideas?
Array ( [0] => 1 [id] => 1 [1] => SIMPLE [select_type] => SIMPLE [2] => chat [table] => chat [3] => range [type] => range [4] => reciever,type,postedby [possible_keys] => reciever,type,postedby [5] => type [key] => type [6] => 255 [key_len] => 255 [7] => [ref] => [8] => 5552 [rows] => 5552 [9] => Using where; Using filesort [Extra] => Using where; Using filesort )
is what im getting when i explain my query, it consist of a couple or's and and's
$mychat="EXPLAIN SELECT * from chat where type='chest'";
$mychat .=" OR type='auction' AND postedby='Admin'";
$mychat .=" OR type='mutes' AND reciever='$player'";
$mychat .=" OR type='tomutes' AND reciever='$player'";
$mychat .=" order by ID DESC LIMIT 50";
$mychat2=mysql_query($mychat) or die("Chat Error: 4052");
$mychat3=mysql_fetch_array($mychat2);
I have type and reciever and ID and postedby all indexed, theres 20,000 rows and its searching 5000 so its semi working...but i need to get that down even more...any ideas?