質問

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