« Unit testing stored procedures with Junit | Main | Using EXPLAIN EXTENDED to see view query rewrites »

Comments

p

Nice trick, but why aren't those values available from information_schema tables?

Guy

The instantaneous values are indeed obtained from INFORMATION_SCHEMA.GLOBAL_STATUS. The "trick" is to create an historical record of selected values so we can do some trending or historical diagnostics.

In the past we could have done this by running some external program (in perl say) that issued SHOW GLOBAL STATUS commands and saved the values and deltas back into tables in the DB. But with the INFORMATION_SCHEMA table we can get the values within a stored procedure, and with the new events mechanism, we can run that stored procedure _inside_ the database.

Johnny

Great post, I really found this useful! As a sidenote there's this new site on the net which is looking at bringing together like-minded database users & professionals. It's mainly a forum site but looks like it's got potential to grow. Here is a blurb from the site: ---- SQLSet.com the place to go for all things database. The Forums are grouped for easy navigation, registration is quick and simple. Once registered you can begin posting threads and exchanging ideas. ---- I'd recommend visiting if you've got an interest in databases: http://www.sqlset.com Cheers

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment