"SHOW STATUS ..." - Server Status Variables

This section describes Server Status Variables, which are counters used by MySQL server to provide statistics information about its running status.

What Are Server Status Variables? Server Status Variables are counters used by MySQL server to provide statistics information about its running status.

MySQL server supports two scopes for status variables:

Here are some basic guidelines on how to view and manage status variables in Global and Session scopes.

1. "SHOW [...] STATUS" statement can be used to view both global value and session value with different syntaxes:

For example:

mysql> show status like 'sort_scan';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Sort_scan     | 0     |
+---------------+-------+

mysql> show global status like 'sort_scan';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Sort_scan     | 5692  |
+---------------+-------+

2. "FLUSH STATUS" statement can be used to reset some (not all) Status Variables to 0.

Here are some interesting examples of Status Variables:

Table of Contents

 About This Book

 Introduction of SQL

 MySQL Introduction and Installation

 Introduction of MySQL Programs

 PHP Programs and MySQL Server

 Perl Programs and MySQL Servers

 Java Programs and MySQL Servers

 Datatypes and Data Literals

 Operations and Expressions

 Character Strings and Bit Strings

 Commonly Used Functions

 Table Column Types for Different Types of Values

 Using DDL to Create Tables and Indexes

 Using DML to Insert, Update and Delete Records

 Using SELECT to Query Database

 Window Functions for Statistical Analysis

 Use Index for Better Performance

 Transaction Management and Isolation Levels

 Locks Used in MySQL

 Defining and Calling Stored Procedures

 Variables, Loops and Cursors Used in Stored Procedures

 System, User-Defined and Stored Procedure Variables

MySQL Server Administration

 MySQL Program Option Files

 "SHOW" - Show Server Information

"SHOW STATUS ..." - Server Status Variables

 Capture Slow Queries

 Analyze Slow Query Log File

 Solutions for Slow Queries

 Server Performance Troubleshooting

 Storage Engines in MySQL Server

 InnoDB Storage Engine - Primary and Secondary Indexes

 Performance Tuning and Optimization

 Bulk Changes on Large Tables

 MySQL Server on macOS

 Installing MySQL Server on Linux

 Connection, Performance and Second Instance on Linux

 Archived Tutorials

 References

 Full Version in PDF/EPUB