Pregunta

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

¿Fue útil?

Solución

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';
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top