Forum Moderators: coopster
i have a site who is running very hard on server (CPU processor will not resist many more).MySql is the most solicited.
I think the random function is guilty. Is a better way to write the code to improve the speed of selection ?
$sql = "select * from product_table WHERE (category='$category' and subcategory='$subcategory') ORDER BY RAND() LIMIT 5";
$result = mysql_query ($sql);
while($row = mysql_fetch_array($result)){$doc_id=$row["doc_id"];
$ description ..etc
echo"
product
If anyone have experienced or hear about a very good way for random results can suggest me a theoretical solution and i will search to apply it in fact.