Mysql – How performance schema in thesql 5.6 improve performance

information-schemaMySQLmysql-5.5mysql-5.6performance

Since MySQL 5.5 performance_schema database has been added likewise information_schema.
As we know that tables in information_schema contains statistical information like tables, plugins, partitions, processlist, status and global variables etc.
Just like, performance_schema contains a lot of tables.

  • But, how can we use these tables to improve performance of an
    application based on MySQL 5.6?

Best Answer

Please note the difference between the information_schema and performance_schema databases

INFORMATION_SCHEMA

The information_schema database is an inventory of all objects within the MySQL instance

Such objects include:

  • databases
  • tables
  • columns
  • constraints
  • indexes (called statistics)
  • processlist
  • locks

I wrote a nice post about this 3 years ago : How is INFORMATION_SCHEMA implemented in MySQL?

PERFORMANCE_SCHEMA

The performance_schema database is an instrumentation platform that collects statistics about phases of a running query. Such info can give you hints to tune the query or the environment. You only need to enable it when debugging and troubleshooting queries in conjunction with adding indexes (may or may not be necessary) and adjusting buffer settings (again, may or may not be necessary).

I have not written much about performance_schema since I do not use it that often (Mentioned in my old post Is there any way to get the estimate cost of executing a query in MySQL?).

Derek Downey also wrote a quick post on it : What is the usage of performance_schema in MySQL 5.5?

There is a wealth of information on how to use the performance_schema I think you will enjoy