문제

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

도움이 되었습니까?

해결책

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';
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top