SlideShare a Scribd company logo
Mysql Performance Schema in Action
Presenter by
S Kannan
Database Engineer
Mydbops 12th Webinar
www.mydbops.com info@mydbops.com
❏ Database Engineer
❏ Interest on Mysql and its related tech
❏ Active Learner
About Me
Mydbops at a Glance
● Founded in 2015, HQ in Bangalore India, 70+ Employees.
● Mydbops is on Database Consulting with core specialization on MySQL, MongoDB and PostgreSQL
Administration and Support.
● Mydbops was created with a motto of developing a DevOPS model for Database Administration.
● We help organisations to scale in MySQL/Mongodb/postgresql and implement the advanced technologies in
MySQL/Mongodb/PostgreSQL.
Mydbops at a Glance
Happy Customers
4
Agenda
● Introduction
● Performance Schema
● How performance schema Works ?
● Performance schema Terminology
● What is Instruments and how instruments get Data
● Instruments on various Mysql version
● Sys schema
● Demo
Introduction
What is Performance schema ?
❏Performance Schema is a feature for monitoring MySQL Server execution at a low level .
❏It was introduced in MySQL 5.5 .
❏It provides a way to inspect internal execution of the server at runtime .
❏Performance Schema events are specific to a given instance of the MySQL Server
❏It gives an insight what is happening behind the screen .
❏It was implemented as a Storage engine.
Performance Schema terminology
❖Actor
❖Consumer
❖Digest
❖Dynamic Configuration
❖Event
❖Instrument
❖Object
❖Setup Table
❖Summary table
❖Threads
How Performance Schema Works ?
Instruments:
❖Instruments are the code points where the measurements are done.
❖There are two types of instruments:
1) Timed instruments (Events)
2) Untimed instruments (count errors and memory usage)
❖Name of the monitored activity
❖Stored in performance_schema.setup_instruments table
❖More than 1200 instruments are in mysql 8
Config Server:
● Config servers store metadata and configuration settings for the cluster. As of MongoDB 3.4, config servers must
be deployed as a replica set (CSRS).
● If your cluster has a single config server, then the config server is a single point of failure.
● If the config server is inaccessible, the cluster is not accessible.
● If you cannot recover the data on a config server, the cluster will be inoperable.
● Always use three config servers for production deployments
How Instruments get data ?
S Consumers:
❖ It Process the data collected by the instruments and make it available on performance schema
❖ The consumers are defined in the setup_consumers table
❖ consumer name has a column to specify whether the consumer is enabled
S Events:
❖ An event is the result of a consumer recording the data collected by an instrument.
❖ It is used to observe the flow in mysql.
❖ Events are linked such that in general an event both has a parent and one or more child event.
S Event Types:
❖ Transactions
❖ Statements
❖ Stages
❖ Waits
S Threads:
❏ A thread is a fundamental concept in the Performance Schema.
❏ It handles a connections or Performing background operations.
❏ Mysql have several threads in parallel .
❏ Each thread has an Id (thread id).
❏ Stored in performance_schema.threads table
Performance Schema Table Types:
❖ Setup
❖ Event
❖ Instance
❖ Summary
❖ Histogram
❖ Connections and Threads
❖ Replication
❖ Lock
❖ Variable
❖ Clone
❖ Miscellaneous
S Statistics tables in performance schema
❖ Setup tables
❖ Events tables
❖ Summary tables
❖ Instance tables
❖ Lock tables
❖ Replication Summary
Instruments on various mysql version:
nstruments on various mysql version:
Mysql 5.6 Mysql 8
52 Tables 102 Ta
561 Instruments 10202 Instrume
589 ( percona server) 1229 (percona ser
31 Variables 44 variab
Mysql
87 Ta
1029 Instrume
1067 ( percona ser
42 Variables
High level Instruments on mysql 8
❏Memory
❏Idle
❏Stage
❏Transaction
❏Wait
❏Statement
❏error
S Sys schema:
❖ Sys schema reads and present the data.
❖ This is "user friendly" Performance Schema .
❖ The sys schema includes tables and triggers, views, and stored procedures and functions .
❖ The sys schema contains many views that summarize Performance Schema tables in various ways.
❖ Sys schema objects can be used for typical tuning and diagnosis use cases .
Unclosed Connections not closed properly :
Unused Index:
User created temporary tables on disk:
MySQL Performance Schema in Action

More Related Content

PPTX
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
PDF
Exploring BigData with Google BigQuery
PPTX
Semi-Supervised SVM
PDF
Parallel Replication in MySQL and MariaDB
PDF
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
PPTX
CockroachDB
PDF
ProxySQL High Availability (Clustering)
PDF
CockroachDB: Architecture of a Geo-Distributed SQL Database
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Exploring BigData with Google BigQuery
Semi-Supervised SVM
Parallel Replication in MySQL and MariaDB
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
CockroachDB
ProxySQL High Availability (Clustering)
CockroachDB: Architecture of a Geo-Distributed SQL Database

What's hot (20)

PDF
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
PPTX
산동네 게임 DBA 이야기
PDF
MySQL Parallel Replication: inventory, use-case and limitations
PDF
PDF
Using all of the high availability options in MariaDB
PDF
All about Zookeeper and ClickHouse Keeper.pdf
PDF
ClickHouse Monitoring 101: What to monitor and how
PDF
Planning for Disaster Recovery (DR) with Galera Cluster
PPTX
Maxscale 소개 1.1.1
PDF
Achieving compliance With MongoDB Security
PDF
MySQL Advanced Administrator 2021 - 네오클로바
PDF
Bigtable: A Distributed Storage System for Structured Data
KEY
PostgreSQL
PPTX
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
PDF
MySQL/MariaDB Proxy Software Test
PDF
MySQL User Group NL - MySQL 8
PPTX
MySQL8.0_performance_schema.pptx
PDF
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
PDF
Big Query Basics
PDF
Data Privacy with Apache Spark: Defensive and Offensive Approaches
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
산동네 게임 DBA 이야기
MySQL Parallel Replication: inventory, use-case and limitations
Using all of the high availability options in MariaDB
All about Zookeeper and ClickHouse Keeper.pdf
ClickHouse Monitoring 101: What to monitor and how
Planning for Disaster Recovery (DR) with Galera Cluster
Maxscale 소개 1.1.1
Achieving compliance With MongoDB Security
MySQL Advanced Administrator 2021 - 네오클로바
Bigtable: A Distributed Storage System for Structured Data
PostgreSQL
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
MySQL/MariaDB Proxy Software Test
MySQL User Group NL - MySQL 8
MySQL8.0_performance_schema.pptx
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Big Query Basics
Data Privacy with Apache Spark: Defensive and Offensive Approaches
Ad

Similar to MySQL Performance Schema in Action (20)

PDF
MySQL Utilities -- PyTexas 2015
PDF
High Performance SSRS
PDF
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
PDF
Whatsnew in-my sql-primary
PDF
The Proper Care and Feeding of MySQL Databases
PPTX
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
PDF
MySQL Workbench for DFW Unix Users Group
PPTX
MongoDB vs ScyllaDB: Tractian’s Experience with Real-Time ML
PDF
Data has a better idea the in-memory data grid
PPTX
Ssis Best Practices Israel Bi U Ser Group Itay Braun
PDF
MySQL up and running 30 minutes.pdf
PDF
Evolution of DBA in the Cloud Era
PDF
Automated Database Sanitization with AWS
PDF
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
PPTX
SAS Institute on Changing All Four Tires While Driving an AdTech Engine at Fu...
PPTX
Store procedures
PPTX
MOOC_PRESENTATION_FINAL_PART_1[1].pptx
PDF
Why & how to optimize sql server for performance from design to query
PDF
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
PDF
BITS: Introduction to MySQL - Introduction and Installation
MySQL Utilities -- PyTexas 2015
High Performance SSRS
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
Whatsnew in-my sql-primary
The Proper Care and Feeding of MySQL Databases
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
MySQL Workbench for DFW Unix Users Group
MongoDB vs ScyllaDB: Tractian’s Experience with Real-Time ML
Data has a better idea the in-memory data grid
Ssis Best Practices Israel Bi U Ser Group Itay Braun
MySQL up and running 30 minutes.pdf
Evolution of DBA in the Cloud Era
Automated Database Sanitization with AWS
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
SAS Institute on Changing All Four Tires While Driving an AdTech Engine at Fu...
Store procedures
MOOC_PRESENTATION_FINAL_PART_1[1].pptx
Why & how to optimize sql server for performance from design to query
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
BITS: Introduction to MySQL - Introduction and Installation
Ad

More from Mydbops (20)

PDF
Scaling TiDB for Large-Scale Application
PDF
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
PDF
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
PDF
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
PDF
AWS Blue Green Deployment for Databases - Mydbops
PDF
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
PDF
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
PDF
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
PDF
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
PDF
Read/Write Splitting using MySQL Router - Mydbops Meetup16
PDF
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
PDF
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
PDF
Demystifying Real time Analytics with TiDB
PDF
Must Know Postgres Extension for DBA and Developer during Migration
PDF
Efficient MySQL Indexing and what's new in MySQL Explain
PDF
Scale your database traffic with Read & Write split using MySQL Router
PDF
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PDF
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
PDF
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
PDF
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Scaling TiDB for Large-Scale Application
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
AWS Blue Green Deployment for Databases - Mydbops
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Read/Write Splitting using MySQL Router - Mydbops Meetup16
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Demystifying Real time Analytics with TiDB
Must Know Postgres Extension for DBA and Developer during Migration
Efficient MySQL Indexing and what's new in MySQL Explain
Scale your database traffic with Read & Write split using MySQL Router
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...

Recently uploaded (20)

PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Construction Project Organization Group 2.pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Sustainable Sites - Green Building Construction
PPTX
Welding lecture in detail for understanding
PPT
Project quality management in manufacturing
CH1 Production IntroductoryConcepts.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Model Code of Practice - Construction Work - 21102022 .pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Construction Project Organization Group 2.pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Embodied AI: Ushering in the Next Era of Intelligent Systems
Internet of Things (IOT) - A guide to understanding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
573137875-Attendance-Management-System-original
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Lesson 3_Tessellation.pptx finite Mathematics
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
OOP with Java - Java Introduction (Basics)
Sustainable Sites - Green Building Construction
Welding lecture in detail for understanding
Project quality management in manufacturing

MySQL Performance Schema in Action

  • 1. Mysql Performance Schema in Action Presenter by S Kannan Database Engineer Mydbops 12th Webinar www.mydbops.com info@mydbops.com
  • 2. ❏ Database Engineer ❏ Interest on Mysql and its related tech ❏ Active Learner About Me
  • 3. Mydbops at a Glance ● Founded in 2015, HQ in Bangalore India, 70+ Employees. ● Mydbops is on Database Consulting with core specialization on MySQL, MongoDB and PostgreSQL Administration and Support. ● Mydbops was created with a motto of developing a DevOPS model for Database Administration. ● We help organisations to scale in MySQL/Mongodb/postgresql and implement the advanced technologies in MySQL/Mongodb/PostgreSQL.
  • 4. Mydbops at a Glance Happy Customers 4
  • 5. Agenda ● Introduction ● Performance Schema ● How performance schema Works ? ● Performance schema Terminology ● What is Instruments and how instruments get Data ● Instruments on various Mysql version ● Sys schema ● Demo
  • 7. What is Performance schema ? ❏Performance Schema is a feature for monitoring MySQL Server execution at a low level . ❏It was introduced in MySQL 5.5 . ❏It provides a way to inspect internal execution of the server at runtime . ❏Performance Schema events are specific to a given instance of the MySQL Server ❏It gives an insight what is happening behind the screen . ❏It was implemented as a Storage engine.
  • 8. Performance Schema terminology ❖Actor ❖Consumer ❖Digest ❖Dynamic Configuration ❖Event ❖Instrument ❖Object ❖Setup Table ❖Summary table ❖Threads
  • 10. Instruments: ❖Instruments are the code points where the measurements are done. ❖There are two types of instruments: 1) Timed instruments (Events) 2) Untimed instruments (count errors and memory usage) ❖Name of the monitored activity ❖Stored in performance_schema.setup_instruments table ❖More than 1200 instruments are in mysql 8
  • 11. Config Server: ● Config servers store metadata and configuration settings for the cluster. As of MongoDB 3.4, config servers must be deployed as a replica set (CSRS). ● If your cluster has a single config server, then the config server is a single point of failure. ● If the config server is inaccessible, the cluster is not accessible. ● If you cannot recover the data on a config server, the cluster will be inoperable. ● Always use three config servers for production deployments How Instruments get data ?
  • 12. S Consumers: ❖ It Process the data collected by the instruments and make it available on performance schema ❖ The consumers are defined in the setup_consumers table ❖ consumer name has a column to specify whether the consumer is enabled
  • 13. S Events: ❖ An event is the result of a consumer recording the data collected by an instrument. ❖ It is used to observe the flow in mysql. ❖ Events are linked such that in general an event both has a parent and one or more child event.
  • 14. S Event Types: ❖ Transactions ❖ Statements ❖ Stages ❖ Waits
  • 15. S Threads: ❏ A thread is a fundamental concept in the Performance Schema. ❏ It handles a connections or Performing background operations. ❏ Mysql have several threads in parallel . ❏ Each thread has an Id (thread id). ❏ Stored in performance_schema.threads table
  • 16. Performance Schema Table Types: ❖ Setup ❖ Event ❖ Instance ❖ Summary ❖ Histogram ❖ Connections and Threads ❖ Replication ❖ Lock ❖ Variable ❖ Clone ❖ Miscellaneous
  • 17. S Statistics tables in performance schema ❖ Setup tables ❖ Events tables ❖ Summary tables ❖ Instance tables ❖ Lock tables ❖ Replication Summary
  • 18. Instruments on various mysql version:
  • 19. nstruments on various mysql version: Mysql 5.6 Mysql 8 52 Tables 102 Ta 561 Instruments 10202 Instrume 589 ( percona server) 1229 (percona ser 31 Variables 44 variab Mysql 87 Ta 1029 Instrume 1067 ( percona ser 42 Variables
  • 20. High level Instruments on mysql 8 ❏Memory ❏Idle ❏Stage ❏Transaction ❏Wait ❏Statement ❏error
  • 21. S Sys schema: ❖ Sys schema reads and present the data. ❖ This is "user friendly" Performance Schema . ❖ The sys schema includes tables and triggers, views, and stored procedures and functions . ❖ The sys schema contains many views that summarize Performance Schema tables in various ways. ❖ Sys schema objects can be used for typical tuning and diagnosis use cases .
  • 22. Unclosed Connections not closed properly :
  • 24. User created temporary tables on disk: