Question

Is there a way to detect queries that use a lot of CPU ?

I know how to detect long queries but don't know if its possible to detect queries that take mass CPU.

Thanks

Était-ce utile?

La solution

iam not sure what you mean,but with microtime you can find out which query was taken more time for execution like this

$sql='...';
$start=microtime(true);
$mysql_query($sql);
$end=microtime(true)-$start;
echo $end.' seconds'; // in seconds
echo ($end*1000).' milliseconds';
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top