Stop the madness: SHOW STATUS

Are you a MySQL user? Have you tried 5.0? Did you notice that SHOW STATUS was giving you strange results?

Here’s the skinny: The SHOW STATUS command, which has been in MySQL, well forever, has had a long-standing feature request; to have the ability to report its metrics per-session. That functionality was added in MySQL 5.0, in the form of two new syntaxes: SHOW SESSION STATUS and SHOW GLOBAL STATUS to give the per-session and server-wide statistics, respectively. It’s great, and I’m happy to see it.

The problem comes in because of the default behaviour that was chosen for the basic SHOW STATUS with no SESSION or GLOBAL keyword—that is, the command that every MySQL DBA has been using for years—now defaults to per-session statistics.

Every tool, program, monitoring script, performance graph, etc., that uses SHOW STATUS (which is pretty much all of them) is broken in 5.0. Why? Well, for no reason, in my opinion. There is absolutely no advantage to defaulting to per-session statistics instead of the old standard of global statistics.

If you’re upset about this, add your comment to MySQL Bug #19093 and fight the good fight with me.

7 thoughts on “Stop the madness: SHOW STATUS

  1. They changed other things in the past (extra columns in EXPLAIN and SHOW TABLE STATUS). So, I guess I will have to live with these changes. Actually, I just now changed several scripts to “SHOW /*!50002 GLOBAL*/ STATUS”.

    Ok, it is rather dumb to connect, do SHOW STATUS, get a bunch of 0s.

    If SHOW SESSION STATUS should tally how much “work” I did in a benchmark, then Uptime should really show me the connect time.

    Ok, I’m convinced, it is either a bad default or a bad implementation.

  2. Yes, consideration to backwards compatibility needs work. It gets in the way of upgrades and since MySQL wants people to upgrade I hope it’ll receive suitable attention.

  3. And yet, they DON’T make changes that break backwards compatibility in “good” ways. Like erroring out on foreign key definition on myisam tables. Honestly, I’d much rather have myisam error out than pretend to add a foreign key that doesn’t actually add.

  4. jcole’s weblog: Jeremy Cole’s take on life. » Blog Archive » Madness continues: SHOW STATUS

  5. Madness continues: SHOW STATUS

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s