Over the last year there has been alot of work done to instrument
MySQL with static dtrace probes. The mysql provider first became
available in MySQL 6.0.8 but required a build with the
--enable-dtrace flag to enable it. Starting with MySQL 5.4 the
mysql provider and it's static probes are now enabled by default
and ready to be used on Solaris 10, OpenSolaris and Mac OS
X.
The static probes in MySQL 5.4 have been designed to follow the
execution path of a query
with the level getting deeper as the query execution proceeds. However the probes are implemented so that you don't have to traverse the entire hierarchy to get the information you want.
They are also implemented in sets. The -start probe exposes pertinent information such as the query text. The -done probe returns the status of the probe operation. With probe sets time spent within an operation can be captured.
Check out MC Brown's …
[Read more]