This document provides an overview of basic MySQL troubleshooting techniques for Oracle database administrators. It covers MySQL server architecture including connectors, clients, APIs, storage engines, and plugins. It then discusses basic troubleshooting techniques such as error processing, access privileges, and using system variables, performance schema, and EXPLAIN to analyze query execution plans. The document is intended to help Oracle DBAs understand fundamental aspects of MySQL administration.
Performance Schema for MySQL TroubleshootingSveta Smirnova
The Performance Schema provides detailed information for troubleshooting and optimizing MySQL. It collects instrumentation data on server operations, statements, memory usage, locks and connections. The data can be used to identify slow queries, statements not using indexes, memory consumption trends over time, and more. Configuration and enabling specific instruments allows controlling the level of detail collected.
New features in Performance Schema 5.7 in actionSveta Smirnova
The document discusses new features in Performance Schema 5.7, including improved instrumentation for locks, memory usage, stored routines, prepared statements, and variables. It provides examples of using Performance Schema tables like METADATA_LOCKS, TABLE_HANDLES, and prepared_statements_instances to diagnose issues like locks preventing DDL statements from completing and inconsistently timed stored procedure executions. Practices are suggested to identify memory usage and optimize prepared statement performance.
Introducing new SQL syntax and improving performance with preparse Query Rewr...Sveta Smirnova
This document discusses a new preparse query rewrite plugin for MySQL that allows adding new SQL syntax like the FILTER clause from SQL:2003. The plugin works by catching the query before parsing and rewriting parts using regular expressions. It also describes extending the plugin to support custom optimizer hints by modifying and restoring thread-specific variable values.
Performance Schema for MySQL TroubleshootingSveta Smirnova
Percona Live (https://www.percona.com/live/data-performance-conference-2016/sessions/performance-schema-mysql-troubleshooting)
The performance schema in MySQL version 5.6, released in February, 2013, is a very powerful tool that can help DBAs discover why even the trickiest performance issues occur. Version 5.7 introduces even more instruments and tables. And while all these give you great power, you can get stuck choosing which instrument to use.
In this session, I will start with a description of a typical problem, then guide you how to use the performance schema to find out what causes the issue, the reason for unwanted behavior and how the received information can help you solve a particular problem.
Traditionally, performance schema sessions teach what is in contained in tables. I will, in contrast, start from a performance issue, then demonstrate which instruments and tables can help solve it. We will discuss how to setup the performance schema so that it has minimal impact on your server.
Percona Live 2016 (https://www.percona.com/live/data-performance-conference-2016/sessions/why-use-explain-formatjson). Although EXPLAIN FORMAT=JSON was first presented a long time ago, there still aren't many resources that explain how and why to use it. The most advertised feature is visual EXPLAIN in MySQL Workbench, but this format can do more than create nice pictures. It prints additional information that can't be found in good old tabular EXPLAIN, and can help to solve many tricky performance issues. In this session, I will not only describe which additional information we can get with the new syntax, but also provide examples showing how to use it to diagnose production issues.
This document provides an agenda and overview for a MySQL Query Tuning 101 presentation. The summary includes:
1. The agenda covers topics like identifying slow queries, using indexes, the EXPLAIN tool, and other optimization techniques.
2. When queries run slow, the presenter will discuss using indexes to improve performance by allowing MySQL to access data more efficiently.
3. The EXPLAIN tool is covered as a way to estimate query execution and see how MySQL utilizes indexes. Different EXPLAIN output will be demonstrated using examples from an employees database.
Moving to the NoSQL side: MySQL JSON functionsSveta Smirnova
This document provides an overview of JSON functions that have been added to MySQL to support NoSQL and manipulation of JSON documents. It discusses the history and improvements of the JSON functions, provides examples of how various functions such as json_valid, json_contains_key, json_extract, json_append, json_replace, json_set, json_remove, json_search, json_merge, json_depth, and json_count work, and describes how to install and compile the JSON functions. The JSON functions allow users to validate, search, modify, and work with JSON documents directly in MySQL.
This presentation discusses troubleshooting MySQL performance issues. It begins by explaining how to determine if MySQL is the source of slow performance by measuring query response times. The presentation then covers various aspects to check like queries, server options, hardware resources, and replication setup. Specific diagnostic tools are also introduced like EXPLAIN, slow query log, and various system monitoring commands. Finally, it recommends following a structured process of tuning queries, options, and hardware to isolate and resolve any performance problems.
Performance Schema for MySQL TroubleshootingSveta Smirnova
The Performance Schema provides detailed information for troubleshooting and optimizing MySQL. It collects instrumentation data on server operations, statements, memory usage, locks and connections. The data can be used to identify slow queries, statements not using indexes, memory consumption trends over time, and more. Configuration and enabling specific instruments allows controlling the level of detail collected.
New features in Performance Schema 5.7 in actionSveta Smirnova
The document discusses new features in Performance Schema 5.7, including improved instrumentation for locks, memory usage, stored routines, prepared statements, and variables. It provides examples of using Performance Schema tables like METADATA_LOCKS, TABLE_HANDLES, and prepared_statements_instances to diagnose issues like locks preventing DDL statements from completing and inconsistently timed stored procedure executions. Practices are suggested to identify memory usage and optimize prepared statement performance.
Introducing new SQL syntax and improving performance with preparse Query Rewr...Sveta Smirnova
This document discusses a new preparse query rewrite plugin for MySQL that allows adding new SQL syntax like the FILTER clause from SQL:2003. The plugin works by catching the query before parsing and rewriting parts using regular expressions. It also describes extending the plugin to support custom optimizer hints by modifying and restoring thread-specific variable values.
Performance Schema for MySQL TroubleshootingSveta Smirnova
Percona Live (https://www.percona.com/live/data-performance-conference-2016/sessions/performance-schema-mysql-troubleshooting)
The performance schema in MySQL version 5.6, released in February, 2013, is a very powerful tool that can help DBAs discover why even the trickiest performance issues occur. Version 5.7 introduces even more instruments and tables. And while all these give you great power, you can get stuck choosing which instrument to use.
In this session, I will start with a description of a typical problem, then guide you how to use the performance schema to find out what causes the issue, the reason for unwanted behavior and how the received information can help you solve a particular problem.
Traditionally, performance schema sessions teach what is in contained in tables. I will, in contrast, start from a performance issue, then demonstrate which instruments and tables can help solve it. We will discuss how to setup the performance schema so that it has minimal impact on your server.
Percona Live 2016 (https://www.percona.com/live/data-performance-conference-2016/sessions/why-use-explain-formatjson). Although EXPLAIN FORMAT=JSON was first presented a long time ago, there still aren't many resources that explain how and why to use it. The most advertised feature is visual EXPLAIN in MySQL Workbench, but this format can do more than create nice pictures. It prints additional information that can't be found in good old tabular EXPLAIN, and can help to solve many tricky performance issues. In this session, I will not only describe which additional information we can get with the new syntax, but also provide examples showing how to use it to diagnose production issues.
This document provides an agenda and overview for a MySQL Query Tuning 101 presentation. The summary includes:
1. The agenda covers topics like identifying slow queries, using indexes, the EXPLAIN tool, and other optimization techniques.
2. When queries run slow, the presenter will discuss using indexes to improve performance by allowing MySQL to access data more efficiently.
3. The EXPLAIN tool is covered as a way to estimate query execution and see how MySQL utilizes indexes. Different EXPLAIN output will be demonstrated using examples from an employees database.
Moving to the NoSQL side: MySQL JSON functionsSveta Smirnova
This document provides an overview of JSON functions that have been added to MySQL to support NoSQL and manipulation of JSON documents. It discusses the history and improvements of the JSON functions, provides examples of how various functions such as json_valid, json_contains_key, json_extract, json_append, json_replace, json_set, json_remove, json_search, json_merge, json_depth, and json_count work, and describes how to install and compile the JSON functions. The JSON functions allow users to validate, search, modify, and work with JSON documents directly in MySQL.
This presentation discusses troubleshooting MySQL performance issues. It begins by explaining how to determine if MySQL is the source of slow performance by measuring query response times. The presentation then covers various aspects to check like queries, server options, hardware resources, and replication setup. Specific diagnostic tools are also introduced like EXPLAIN, slow query log, and various system monitoring commands. Finally, it recommends following a structured process of tuning queries, options, and hardware to isolate and resolve any performance problems.
Character Encoding - MySQL DevRoom - FOSDEM 2015mushupl
Character encoding configuration in MySQL has always been a bit confusing. With too many options to set, unclear relationships between them, and the default settings that make MySQL incompatible with most languages, it is a headache to many users, many of whom end up with broken data. This lecture will provide an overview of the character set support in MySQL, guidelines on how to use it correctly, and will demonstrate several methods of detecting and repairing mangled data.
This document discusses troubleshooting MySQL performance issues. It begins with an overview of MySQL server architecture and important components like the optimizer and storage engines. It then covers various diagnostic instruments for troubleshooting like log files, the Information Schema, and the Performance Schema. Specific issues covered include single statement performance using EXPLAIN, internal concurrency issues detected via locks diagnostics from sources like SHOW PROCESSLIST and the Performance Schema. The document provides examples of using these diagnostic tools to analyze and optimize query performance.
Performance Schema for MySQL TroubleshootingSveta Smirnova
The Performance Schema in MySQL provides tables and instruments for troubleshooting issues like locks, I/O bottlenecks, slow queries, memory usage, and replication failures. It contains over 500 instruments in MySQL 5.6 and over 800 in 5.7. The tables provide visibility into the internal workings of MySQL to analyze and optimize performance.
New features in Performance Schema 5.7 include instrumentation for locks, memory usage, stored routines, and prepared statements. This provides concise insight into what is causing issues like long wait times, high memory usage, or inconsistent stored routine performance. Administrators can now quickly diagnose these types of issues using the additional visibility provided by the Performance Schema.
This document discusses new SQL syntax and query rewrite plugins in MySQL. It introduces FILTER clauses and custom optimizer hints and describes how to implement them using query rewrite plugins. Key points covered include the plugin interface, parsing and rewriting queries, managing memory, and customizing variables. The goal is to add new SQL features and control query execution through simple syntax extensions. Examples of implementing FILTER clauses and custom optimizer hints are provided to demonstrate how rewrite plugins work.
Basic MySQL Troubleshooting for Oracle DBAsSveta Smirnova
The document provides an overview of MySQL architecture, configuration, troubleshooting and optimization. It discusses MySQL installation layout, log files, connectors, storage engines, concurrency issues, and diagnostic tools like SHOW PROCESSLIST and INFORMATION_SCHEMA for troubleshooting. The presentation agenda includes introduction, single-client issues, concurrency issues, high availability solutions and tools.
This document provides a summary of a presentation on practical MySQL tuning. It discusses measuring critical system resources like CPU, memory, I/O and network usage to identify bottlenecks. It also covers rough tuning of MySQL parameters like the InnoDB buffer pool size, log file size and key buffer size. Further tuning includes application optimizations like query tuning with EXPLAIN, index tuning, and schema design. The presentation also discusses scaling MySQL through approaches like caching, sharding, replication and optimizing architecture and data distribution. Regular performance monitoring is emphasized to simulate increased load and aid capacity planning.
New features in Performance Schema 5.7 in actionSveta Smirnova
New features in Performance Schema 5.7 in action provides an overview of Performance Schema improvements in MySQL 5.7 and 8.0 including new tables, instruments, and variables. It demonstrates how to use Performance Schema to diagnose locks, memory usage, stored routines, and prepared statements. Examples show identifying blocking locks, measuring memory usage by thread, and instrumentation of stored procedure execution and prepared statement statistics.
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
To get data, we query the database. MySQL does its best to return requested bytes as fast as possible. However, it needs human help to identify what is important and should be accessed in the first place.
Queries, written smartly, can significantly outperform automatically generated ones. Indexes and Optimizer statistics, not limited to the Histograms only, help to increase the speed of the query a lot.
In this session, I will demonstrate by examples of how MySQL query performance can be improved. I will focus on techniques, accessible by Developers and DevOps rather on those which are usually used by Database Administrators. In the end, I will present troubleshooting tools which will help you to identify why your queries do not perform. Then you could use the knowledge from the beginning of the session to improve them.
Introduction into MySQL Query Tuning for Dev[Op]sSveta Smirnova
Percona Live Online 2021 talk: https://www.percona.com/resources/videos/introduction-mysql-query-tuning-for-devops
In this talk I will show how to get started with MySQL Query Tuning. I will make a short introduction into physical table structure and demonstrate how it may influence query execution time.
Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite queries or change table structure to achieve better performance.
The document discusses three common ways to improve performance of a MySQL database that is experiencing high load:
1. Upgrade hardware by adding more RAM, faster disks, or more powerful CPUs. This provides a temporary fix but can become exponentially more expensive and does not address underlying issues.
2. Change MySQL configuration settings like tmp_table_size or sort_buffer_size to optimize for specific bottlenecks shown in global status variables, but there are no "silver bullets" and misconfigurations must be addressed.
3. Improve indexing and tune queries by addressing issues like temporary tables on disk, full table scans, and lack of indexes causing full joins or sorting, which can have long term benefits over simply adding resources
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013Sergey Petrunya
The document discusses techniques for identifying and addressing problems with a database query optimizer. It describes old and new tools for catching slow queries, such as the slow query log, SHOW PROCESSLIST, and the Performance Schema. It also provides examples of using these tools to analyze query plans, identify inefficient plans, and determine if optimizer settings or query structure need to be modified to address performance issues.
Talk at "Istanbul Tech Talks" in Istanbul, April, 17, 2018. http://www.istanbultechtalks.com/
In this talk I will show how to get started with MySQL Query Tuning. I will make short introduction into physical table structure and demonstrate how it may influence query execution time. Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite query or change table structure to achieve better performance.
The document discusses improvements to the MariaDB query optimizer. It notes that while MySQL is widely used for web applications and OLTP, it is not well-suited for complex analytics queries on large datasets due to issues with disk access strategies and subquery optimizations. MariaDB 5.3 includes multi-range read and batched key access features that improve disk access, reducing query times by over 10x on benchmark tests. It also includes many additional subquery optimization strategies beyond those in earlier MySQL versions.
- The document discusses using various Oracle diagnostic tools like AWR, ASH, and SQL Monitoring for SQL tuning. It focuses on scenarios where multiple data sources are needed to fully understand performance issues.
- Historical ASH and AWR data can provide different perspectives on SQL executions over time that help identify problems like long-running queries or concurrent executions. However, ASH only samples a subset of data so it may miss short queries.
- GV$SQL and AWR reports aggregate performance metrics over all executions of a SQL, so they do not show the full user experience if a query runs intermittently. ASH sampled data can help determine how database time relates to clock time in such cases.
-
The document discusses MySQL indexing and optimization. It provides an overview of indexing in MySQL, including what indexes are, how they are created, and how MySQL uses indexes to optimize queries. The document also discusses best practices for indexing, including identifying missing indexes, avoiding unnecessary indexes, and ensuring indexes have good selectivity to maximize query performance.
This document discusses SQL objects and PL/SQL datatypes in Oracle. It provides an overview of PL/SQL as an extension to SQL that allows procedural logic. It describes PL/SQL-specific and SQL object datatypes, including records, collections, and pipelined functions. It also covers SQL collection operators and comparing collections in PL/SQL.
This document discusses various data types and SQL commands used in Oracle databases. It covers:
- Common data types like CHAR, VARCHAR2, NUMBER, DATE, LONG, RAW, BLOB, CLOB and how they store data.
- SQL commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), and integrity constraints (PRIMARY KEY, FOREIGN KEY).
- Functions for calculations, string operations and data retrieval from tables.
Character Encoding - MySQL DevRoom - FOSDEM 2015mushupl
Character encoding configuration in MySQL has always been a bit confusing. With too many options to set, unclear relationships between them, and the default settings that make MySQL incompatible with most languages, it is a headache to many users, many of whom end up with broken data. This lecture will provide an overview of the character set support in MySQL, guidelines on how to use it correctly, and will demonstrate several methods of detecting and repairing mangled data.
This document discusses troubleshooting MySQL performance issues. It begins with an overview of MySQL server architecture and important components like the optimizer and storage engines. It then covers various diagnostic instruments for troubleshooting like log files, the Information Schema, and the Performance Schema. Specific issues covered include single statement performance using EXPLAIN, internal concurrency issues detected via locks diagnostics from sources like SHOW PROCESSLIST and the Performance Schema. The document provides examples of using these diagnostic tools to analyze and optimize query performance.
Performance Schema for MySQL TroubleshootingSveta Smirnova
The Performance Schema in MySQL provides tables and instruments for troubleshooting issues like locks, I/O bottlenecks, slow queries, memory usage, and replication failures. It contains over 500 instruments in MySQL 5.6 and over 800 in 5.7. The tables provide visibility into the internal workings of MySQL to analyze and optimize performance.
New features in Performance Schema 5.7 include instrumentation for locks, memory usage, stored routines, and prepared statements. This provides concise insight into what is causing issues like long wait times, high memory usage, or inconsistent stored routine performance. Administrators can now quickly diagnose these types of issues using the additional visibility provided by the Performance Schema.
This document discusses new SQL syntax and query rewrite plugins in MySQL. It introduces FILTER clauses and custom optimizer hints and describes how to implement them using query rewrite plugins. Key points covered include the plugin interface, parsing and rewriting queries, managing memory, and customizing variables. The goal is to add new SQL features and control query execution through simple syntax extensions. Examples of implementing FILTER clauses and custom optimizer hints are provided to demonstrate how rewrite plugins work.
Basic MySQL Troubleshooting for Oracle DBAsSveta Smirnova
The document provides an overview of MySQL architecture, configuration, troubleshooting and optimization. It discusses MySQL installation layout, log files, connectors, storage engines, concurrency issues, and diagnostic tools like SHOW PROCESSLIST and INFORMATION_SCHEMA for troubleshooting. The presentation agenda includes introduction, single-client issues, concurrency issues, high availability solutions and tools.
This document provides a summary of a presentation on practical MySQL tuning. It discusses measuring critical system resources like CPU, memory, I/O and network usage to identify bottlenecks. It also covers rough tuning of MySQL parameters like the InnoDB buffer pool size, log file size and key buffer size. Further tuning includes application optimizations like query tuning with EXPLAIN, index tuning, and schema design. The presentation also discusses scaling MySQL through approaches like caching, sharding, replication and optimizing architecture and data distribution. Regular performance monitoring is emphasized to simulate increased load and aid capacity planning.
New features in Performance Schema 5.7 in actionSveta Smirnova
New features in Performance Schema 5.7 in action provides an overview of Performance Schema improvements in MySQL 5.7 and 8.0 including new tables, instruments, and variables. It demonstrates how to use Performance Schema to diagnose locks, memory usage, stored routines, and prepared statements. Examples show identifying blocking locks, measuring memory usage by thread, and instrumentation of stored procedure execution and prepared statement statistics.
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
To get data, we query the database. MySQL does its best to return requested bytes as fast as possible. However, it needs human help to identify what is important and should be accessed in the first place.
Queries, written smartly, can significantly outperform automatically generated ones. Indexes and Optimizer statistics, not limited to the Histograms only, help to increase the speed of the query a lot.
In this session, I will demonstrate by examples of how MySQL query performance can be improved. I will focus on techniques, accessible by Developers and DevOps rather on those which are usually used by Database Administrators. In the end, I will present troubleshooting tools which will help you to identify why your queries do not perform. Then you could use the knowledge from the beginning of the session to improve them.
Introduction into MySQL Query Tuning for Dev[Op]sSveta Smirnova
Percona Live Online 2021 talk: https://www.percona.com/resources/videos/introduction-mysql-query-tuning-for-devops
In this talk I will show how to get started with MySQL Query Tuning. I will make a short introduction into physical table structure and demonstrate how it may influence query execution time.
Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite queries or change table structure to achieve better performance.
The document discusses three common ways to improve performance of a MySQL database that is experiencing high load:
1. Upgrade hardware by adding more RAM, faster disks, or more powerful CPUs. This provides a temporary fix but can become exponentially more expensive and does not address underlying issues.
2. Change MySQL configuration settings like tmp_table_size or sort_buffer_size to optimize for specific bottlenecks shown in global status variables, but there are no "silver bullets" and misconfigurations must be addressed.
3. Improve indexing and tune queries by addressing issues like temporary tables on disk, full table scans, and lack of indexes causing full joins or sorting, which can have long term benefits over simply adding resources
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013Sergey Petrunya
The document discusses techniques for identifying and addressing problems with a database query optimizer. It describes old and new tools for catching slow queries, such as the slow query log, SHOW PROCESSLIST, and the Performance Schema. It also provides examples of using these tools to analyze query plans, identify inefficient plans, and determine if optimizer settings or query structure need to be modified to address performance issues.
Talk at "Istanbul Tech Talks" in Istanbul, April, 17, 2018. http://www.istanbultechtalks.com/
In this talk I will show how to get started with MySQL Query Tuning. I will make short introduction into physical table structure and demonstrate how it may influence query execution time. Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite query or change table structure to achieve better performance.
The document discusses improvements to the MariaDB query optimizer. It notes that while MySQL is widely used for web applications and OLTP, it is not well-suited for complex analytics queries on large datasets due to issues with disk access strategies and subquery optimizations. MariaDB 5.3 includes multi-range read and batched key access features that improve disk access, reducing query times by over 10x on benchmark tests. It also includes many additional subquery optimization strategies beyond those in earlier MySQL versions.
- The document discusses using various Oracle diagnostic tools like AWR, ASH, and SQL Monitoring for SQL tuning. It focuses on scenarios where multiple data sources are needed to fully understand performance issues.
- Historical ASH and AWR data can provide different perspectives on SQL executions over time that help identify problems like long-running queries or concurrent executions. However, ASH only samples a subset of data so it may miss short queries.
- GV$SQL and AWR reports aggregate performance metrics over all executions of a SQL, so they do not show the full user experience if a query runs intermittently. ASH sampled data can help determine how database time relates to clock time in such cases.
-
The document discusses MySQL indexing and optimization. It provides an overview of indexing in MySQL, including what indexes are, how they are created, and how MySQL uses indexes to optimize queries. The document also discusses best practices for indexing, including identifying missing indexes, avoiding unnecessary indexes, and ensuring indexes have good selectivity to maximize query performance.
This document discusses SQL objects and PL/SQL datatypes in Oracle. It provides an overview of PL/SQL as an extension to SQL that allows procedural logic. It describes PL/SQL-specific and SQL object datatypes, including records, collections, and pipelined functions. It also covers SQL collection operators and comparing collections in PL/SQL.
This document discusses various data types and SQL commands used in Oracle databases. It covers:
- Common data types like CHAR, VARCHAR2, NUMBER, DATE, LONG, RAW, BLOB, CLOB and how they store data.
- SQL commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), and integrity constraints (PRIMARY KEY, FOREIGN KEY).
- Functions for calculations, string operations and data retrieval from tables.
1. The document provides an overview of basic Oracle financial functions including journal entries, document numbering, budgets, accounts payable, accounts receivable, and more.
2. Key functions of Oracle General Ledger include recording journal entries from other modules, assigning categories and sources to journal entries, and maintaining journals in batches.
3. The document describes how to enter journal entries including assigning document numbers, categories, periods, and reversal information. It also covers submitting journal batches for approval and entering journals for prior periods.
This document discusses key concepts and steps related to implementing and customizing Oracle Applications. It describes the different environments used - development, testing, and production. It also explains concepts like profile options, organizations, forms, concurrent programs, value sets, lookups, flexfields, and tools used for installation and administration like FNDLOAD and bouncing Apache.
The document discusses Oracle database architecture including the relationship between Oracle software, operating system resources like CPUs, memory and disks, Oracle processes like background processes and server processes, and database structures like the system global area (SGA), program global area (PGA), control files, redo logs and data files. It also covers Oracle memory management, instance startup/shutdown, and basic database administration tasks.
Oracle architecture with details-yogiji creationsYogiji Creations
Oracle is a database management system with a multi-tiered architecture. It consists of a database on disk that contains tables, indexes and other objects. An Oracle instance contains a memory area called the System Global Area that services requests from client applications. Background processes facilitate communication between the memory structures and database files on disk. Logical database structures like tablespaces, segments, extents and blocks help organize and manage the physical storage of data.
Oracle Database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. Oracle Database was started in 1977 as Software Development Laboratories by Larry Ellison and others. Over time, Oracle released several major versions that added new functionality, such as Oracle 12c which was designed for cloud computing. A database server is the key to solving problems of information management by allowing storage, retrieval, and manipulation of data.
The document discusses preparing for an upgrade from an earlier version of Oracle Database to Oracle Database 11g. It covers checking support policies, required patching, important alerts, recommended upgrade paths, and ensuring the proper timezone version is installed to complete the upgrade. Diagnostics, testing, and best practices for the upgrade process are also mentioned.
The document advertises Oracle database books and resources from O'Reilly including titles on Oracle performance optimization, SQL and PL/SQL programming, application servers, and DBA guides. It also provides links to the O'Reilly online book catalog and developer portal for Oracle and other emerging technologies, where readers can find book samples, code examples, and information on new platforms.
Oracle Architecture document discusses:
1. The cost of an Oracle Enterprise Edition license is $47,500 per processor.
2. It provides an overview of key Oracle components like the instance, database, listener and cost based optimizer.
3. It demonstrates how to start an Oracle instance, check active processes, mount and open a database, and query it locally and remotely after starting the listener.
The document provides examples of SQL queries and solutions to interview questions related to SQL queries on Oracle databases. It includes queries to find products with continuously increasing sales, products with no sales, products whose sales decreased in 2012 vs 2011, the top product sold each year, and total sales of each product. Tables called PRODUCTS and SALES are created with sample data on products and sales to demonstrate the example queries.
This document provides an introduction to the SELECT clause in SQL and how to write basic and advanced SELECT statements. It covers selecting columns, using literals and operators, filtering rows with comparison and logical operators, and ordering results with the ORDER BY clause. Examples are provided for concatenation, mathematical expressions, restricting rows based on conditions, pattern matching with LIKE, and sorting ascending or descending.
Web application performance correlates with page views. Find out in this session how to maximize the performance of the OCI8 database extension to build fast, scalable web sites and attract users. Includes discussion of Oracle Database 11.2 and the upcoming PHP OCI8 1.4 extension.
An Oracle database instance consists of background processes that control one or more databases. A schema is a set of database objects owned by a user that apply to a specific application. Tables store data in rows and columns, and indexes and constraints help maintain data integrity and improve query performance. Database administrators perform tasks like installing and upgrading databases, managing storage, security, backups and high availability.
This document provides an overview of the Oracle database architecture. It describes the major components of Oracle's architecture, including the memory structures like the system global area and program global area, background processes, and the logical and physical storage structures. The key components are the database buffer cache, redo log buffer, shared pool, processes, tablespaces, data files, and redo log files.
The document discusses database design and relational database management systems. It covers key concepts like normalization, primary keys, foreign keys, and relationships between tables. Normalization is the process of organizing data to eliminate redundancy and ensure data is stored correctly. There are five normal forms with third normal form being sufficient for most applications. Tables are related through primary and foreign keys and different types of relationships can exist between tables like one-to-one, one-to-many, and many-to-many.
MySQL 5.7 innodb_enhance_partii_20160527Saewoong Lee
Release Date : 2016.05.27
Version : MySQL 5.7
Index :
- Part I : InnoDB Performance
- Part I : InnoDB Buffer Pool Flushing
- Part I : InnoDB internal Transaction General
- Part I : InnoDB Improved adaptive flushing
- Part II : InnoDB Online DDL
- Part II : Tablespace management
- Part II : InnoDB Bulk Load for Create Index
- Part II : InnoDB Temporary Tables
- Part II : InnoDB Full-Text CJK Support
- Part II : Support Syslog on Linux / Unix OS
- Part II : Performance_schema
- Part II : Useful tips
My talk for "MySQL, MariaDB and Friends" devroom at Fosdem on February 2, 2019
Born in 2010 in MySQL 5.5.3 as "a feature for monitoring server execution at a low level," grown in 5.6 times with performance fixes and DBA-faced features, in MySQL 5.7 Performance Schema is a mature tool, used by humans and more and more monitoring products. It becomes more popular over the years. In this talk I will give an overview of Performance Schema, focusing on its tuning, performance, and usability.
Performance Schema helps to troubleshoot query performance, complicated locking issues, memory leaks, resource usage, problematic behavior, caused by inappropriate settings and much more. It comes with hundreds of options which allow precisely tune what to instrument. More than 100 consumers store collected data.
Performance Schema is a potent tool. And very complicated at the same time. It does not affect performance in most cases and can slow down server dramatically if configured without care. It collects a lot of data, and sometimes this data is hard to read.
This talk will start from the introduction of how Performance Schema designed, and you will understand why it slowdowns server in some cases and does not affect your queries in others. Then we will discuss which information you can retrieve from Performance Schema and how to do it effectively.
I will cover its companion sys schema and graphical monitoring tools.
This document discusses various tools and techniques for profiling and optimizing MySQL query performance, including:
- Using tools like Apache ab, JMeter, and Siege to measure baseline performance and identify focus areas like latency and throughput.
- Profiling PHP applications with Xdebug to identify expensive queries and operations.
- Analyzing slow query logs, MySQL query profiling and the performance schema to find slow and expensive queries.
- Using EXPLAIN to analyze and optimize query execution plans and indexes.
- MySQL Enterprise Monitor and Query Analyzer for centralized monitoring of queries across servers.
This document discusses various tools and techniques for profiling and optimizing MySQL query performance, including:
- Using tools like Apache ab, JMeter, and Siege to measure baseline performance and identify focus areas like latency and throughput.
- Profiling PHP applications with Xdebug to identify expensive queries and operations.
- Analyzing slow query logs, MySQL query profiling and the performance schema to find slow and expensive queries.
- Using EXPLAIN to analyze and optimize query execution plans and indexes.
- MySQL Enterprise Monitor and Query Analyzer for centralized monitoring of queries across servers.
Basic MySQL Troubleshooting for Oracle DBAsSveta Smirnova
The document discusses troubleshooting MySQL performance issues. It begins with an introduction to MySQL architecture including installation layout, log files, connectors, storage engines, and plugins. It then covers basic troubleshooting techniques such as checking access privileges, using EXPLAIN to analyze query plans, and reviewing system variables and startup options that could affect performance. Methods for interpreting error messages and using the INFORMATION_SCHEMA database to obtain metadata are also summarized.
Common Schema is a MySQL DBA toolkit that provides a self-contained database schema with tables, views, and stored routines to help with monitoring, security, and analyzing schema objects. It can be installed by running an SQL script and provides built-in documentation and help functions.
Common Schema is a MySQL DBA toolkit that provides a self-contained database schema with tables, views, and stored routines. It allows users to monitor servers, analyze security and objects, and access documentation directly from SQL queries. The presentation introduces Common Schema's key capabilities and provides examples of monitoring status variables, accessing help documentation, and analyzing data size and object information.
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
Oracle Week 2017 slides.
Agenda:
Basics: How and What To Tune?
Using the Automatic Workload Repository (AWR)
Using AWR-Based Tools: ASH, ADDM
Real-Time Database Operation Monitoring (12c)
Identifying Problem SQL Statements
Using SQL Performance Analyzer
Tuning Memory (SGA and PGA)
Parallel Execution and Compression
Oracle Database 12c Performance New Features
Advanced Query Optimizer Tuning and AnalysisMYXPLAIN
The document discusses techniques for identifying and addressing problems with a database query optimizer. It describes how to use tools like the slow query log, SHOW PROCESSLIST, and PERFORMANCE SCHEMA to find slow queries and examine their execution plans. The document provides examples of analyzing queries, identifying inefficient plans, and determining appropriate actions like rewriting queries or adjusting optimizer settings.
This document describes setting up and testing ProxySQL for query routing and high availability with Percona XtraDB Cluster (PXC). It includes instructions for installing and configuring ProxySQL, adding backend PXC servers, creating query rules for routing, and testing read/write splitting and failover through sysbench tests. Failover is demonstrated by stopping one PXC node, and ProxySQL is shown routing queries to the remaining nodes and marking the failed node as offline in its status.
The document discusses diagnosing and mitigating MySQL performance issues. It describes using various operating system monitoring tools like vmstat, iostat, and top to analyze CPU, memory, disk, and network utilization. It also discusses using MySQL-specific tools like the MySQL command line, mysqladmin, mysqlbinlog, and external tools to diagnose issues like high load, I/O wait, or slow queries by examining metrics like queries, connections, storage engine statistics, and InnoDB logs and data written. The agenda covers identifying system and MySQL-specific bottlenecks by verifying OS metrics and running diagnostics on the database, storage engines, configuration, and queries.
MySQL® 5.7 is a great release which has a lot to offer, especially in the development and replication areas. It provides a lot of new optimizer features for developers to take advantage of, a much more powerful GIS function and high performance JSON data type, allowing for a more powerful store for semi-structured data. It also features dramatically improved Performance Schema, Parallel and Multi-Source replication, allowing you to scale much further than ever before, just to give you a taste. In this webinar, we will provide an overview of the most important MySQL 5.7 features.
This webinar will be part of a 3-part series which will include MySQL 5.7 for Developers and MySQL 5.7 for DBAs.
This document provides an overview and introduction to ProxySQL, including:
- Key features such as load balancing, failover, connection pooling, multiplexing, statistics, query rewriting, and firewall capabilities
- Configuration examples for setting up servers, users, and query rules to implement load balancing of reads and writes
- Uses of ProxySQL for replication, PXC/Galera clustering, caching queries, mirroring queries for buffer warming, and troubleshooting
The presentation contains details on how to leverage various ProxySQL tables and functions to configure these capabilities.
This document provides an overview of optimizing MySQL performance for DevOps. It discusses hardware configuration including memory, disk, CPU and network. It covers important MySQL configuration options like InnoDB settings. It also discusses query tuning techniques like using indexes to improve query performance.
Streaming ETL - from RDBMS to Dashboard with KSQLBjoern Rost
Apache Kafka is a massively scalable message queue that is being used at more and more places connecting more and more data sources. This presentation will introduce Kafka from the perspective of a mere mortal DBA and share the experience of (and challenges with) getting events from the database to Kafka using Kafka connect including poor-man’s CDC using flashback query and traditional logical replication tools. To demonstrate how and why this is a good idea, we will build an end-to-end data processing pipeline. We will discuss how to turn changes in database state into events and stream them into Apache Kafka. We will explore the basic concepts of streaming transformations using windows and KSQL before ingesting the transformed stream in a dashboard application.
The document provides tips for optimizing performance of MySQL databases by discussing settings for variables in MySQLD to optimize memory usage and query processing, settings for the MyISAM and InnoDB storage engines to improve performance, and methods for examining slow query logs and using EXPLAIN to identify and address inefficient queries.
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
This document discusses different methods for performing schema upgrades in a Galera cluster, including Total Order Isolation (TOI), Rolling Schema Upgrade (RSU), and the pt-online-schema-change tool. TOI blocks the entire cluster during DDL but ensures consistency, while RSU allows upgrades without blocking the cluster but requires stopping writes and carries risks of inconsistency. Pt-online-schema-change performs non-blocking upgrades using triggers to copy rows to a new table in chunks.
MySQL Baics - Texas Linxufest beginners tutorial May 31st, 2019Dave Stokes
MySQL is a relational database management system. The document provides an introduction to MySQL, including:
- MySQL is available in both community and enterprise editions. The community edition is free to use while the enterprise edition starts at $5K/4 core CPU before discounts.
- Data in MySQL is organized into tables within schemas (or databases). Tables contain rows of data organized into columns.
- Structured Query Language (SQL) is used to interact with MySQL databases. Common SQL commands include SELECT to retrieve data, INSERT to add data, UPDATE to modify data, and DELETE to remove data.
- JOIN clauses allow retrieving data from multiple tables by linking them together on common columns. This helps normalize data
OSMC 2008 | Monitoring MySQL by Geert VanderkelenNETWAYS
Monitoring MySQL has a long history within Nagios. Several plugins are available already. In addition to that, there are probably lots of plugins that have been developed by the community. We take a look at some of these and discuss what kind of additional useful information could be pulled out of a MySQL Server for monitoring it even better. A simple example on how to write such plugins will be shown, also using NDB API for monitoring MySQL Cluster. Now that MySQL Enterprise Monitor (MEM) is available, we'll go through the possibilities for combining the two platforms. We will also discuss the NDOUtils for storing configuration and event data using MySQL.
This talk starts with a brief overview of MySQL itself: some history, where it's heading too, and why it is so successful.
Similar to Basic MySQL Troubleshooting for Oracle Database Administrators (20)
MySQL 2024: Зачем переходить на MySQL 8, если в 5.х всё устраивает?Sveta Smirnova
25 октябрая 2023 года Oracle прекратила активную поддержку MySQL 5.7.
Это значит, что стоит присмотреться к улучшениям в версии 8:
- Новому системному словарю
- Современному SQL
- Поддержке JSON, NoSQL, MySQL Shell, и возможности работать с MySQL как с MongoDB
- Улучшениям в оптимизаторе запросов и диагностике
Мой доклад для разработчиков приложений под MySQL. Я не буду рассказывать как конфигурировать сервер и сфокусируюсь на его использовании.
Database in Kubernetes: Diagnostics and MonitoringSveta Smirnova
Kubernetes is the new cool in 2023. Many database installations are on Kubernetes now. And this creates challenges for Support engineers because traditional monitoring and diagnostic tools work differently on bare hardware and Kubernetes. In this session, I will focus on differences in methods we use to collect metrics, describe challenges that Percona Support hits when working with database installations on Kubernetes, and discuss how we resolve them. This talk will cover all database technologies we support: MySQL, MongoDB, and PostgreSQL.
Presented at Percona Live 2023
MySQL Database Monitoring: Must, Good and Nice to HaveSveta Smirnova
It is very easy to find if a database installation is having issues. You only need to enable Operating System monitoring. A disk, memory, or CPU usage change will alert you about the problems. But they would not show *why* the trouble happens. You need the help of database-specific monitoring tools.
As a Support Engineer, I am always very upset when handling complaints about the database behavior lacking specific database monitoring data because I cannot help!
There are two reasons database and system administrators do not enable necessary instrumentation. The first is a natural or expected performance impact. Second is the lack of knowledge on what needs to be on to resolve a particular issue.
In this talk, I will cover both concerns.
I will show which monitoring instruments will give information on what causes disk, memory, or CPU problems.
I will teach you how to use them.
I will uncover which performance impact these instruments have.
I will use both MySQL command-line client and open-source graphical instrument Percona Monitoring and Management (PMM) for the examples.
This document provides an overview of the MySQL Cookbook by O'Reilly. It discusses the intended audience of database administrators and developers. It also demonstrates different ways of interacting with MySQL, including through the command line interface, MySQL Shell, and X DevAPI. Examples are provided for common tasks like reading, writing, and updating data in both standard SQL and the object-oriented X DevAPI.
MySQL performance can be improved by tuning queries, server options, and hardware. Traditionally it was an area of responsibility for three different roles: Development, DBA, and System Administrators. Now DevOps handle these all. But there is a gap. Knowledge gained by MySQL DBAs after years or focusing on a single product is hard to gain when you focus on more than one. This is why I am doing this session. I will show a minimal but most effective set of options to improve MySQL performance. For illustrations, I will use real user stories gained from my Support experience and Percona Kubernetes operators for PXC and MySQL.
MySQL Test Framework для поддержки клиентов и верификации баговSveta Smirnova
Talk for TestDriven Conf: https://tdconf.ru/2022/abstracts/8763
MySQL Test Framework (MTR) — это фреймворк для регрессионных тестов MySQL. Тесты для него пишут разработчики MySQL и запускаются во время подготовки к новым релизам.
MTR можно использовать и по-другому. Я его использую, чтобы тестировать проблемы, о которых сообщают клиенты, и подтверждать сообщения об ошибках (bug reports) одновременно на нескольких версиях MySQL.
При помощи MTR можно:
* программировать сложные развёртывания;
* тестировать проблему на нескольких версиях MySQL/Percona/MariaDB-серверов при помощи одной команды;
* тестировать несколько одновременных соединений;
* проверять ошибки и возвращаемые значения;
* работать с результатами запросов, хранимыми процедурами и внешними командами.
Тест может быть запущен на любой машине с MySQL-, Percona- или MariaDB-сервером.
Я покажу, как я работаю с MySQL Test Framework, и надеюсь, что вы тоже полюбите этот инструмент.
This document provides an overview of different ways to work with MySQL using standard SQL, X DevAPI, and MySQL Shell utilities. It discusses querying, updating, and exporting/importing data using these different approaches. It also covers topics like character encoding, generating summaries, storing errors, and retrieving metadata. Examples are provided to illustrate concepts like selecting, grouping, joining, changing data, common table expressions, and more using SQL and X DevAPI. MySQL Shell utilities for exporting/importing CSV, JSON, and working with collections are also demonstrated.
Talk for the DevOps Pro Moscow 2021: https://www.devopspro.ru/Sveta-Smirnova/
Производительность MySQL можно улучшить при помощи оптимизации запросов, настроек MySQL сервера и железа. Традиционно эти задачи распределялись между тремя ролями: Разработчик, Администратор баз данных и Системный Администратор. Теперь же все эти задачи решает DevOps, что непросто для одного человека. В этом докладе я расскажу об основных оптимизациях, которые решают большинство проблем производительности MySQL. Для иллюстраций я буду использовать реальные пользовательские истории и Percona Kubernetes Operator.
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterSveta Smirnova
Percona XtraDB Cluster (PXC) is a 100% synchronized cluster in regards to DML operations. It is ensured by the optimistic locking model and ability to rollback transaction which cannot be applied on all nodes. However, DDL operations are not transactional in MySQL. This adds complexity when you need to change the schema of the database.
Changes made by DDL may affect the results of the queries. Therefore all modifications must replicate on all nodes prior to the next data access. For operations that run momentarily, it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to the safest synchronous blocking schema upgrade method: TOI, - PXC supports more relaxed, though not safe, method RSU.
RSU: Rolling Schema Upgrade is advertised to be non-blocking. But you still need to take care of updates, running while you are performing such an upgrade. Surprisingly, even updates on not related tables and schema can cause RSU operation to fail.
In this talk, I will uncover nuances of PXC schema upgrades and point to details you need to take special care about.
Further Information
Schema change is a frequent task, and many do not expect any surprises with it. However, the necessity to replay the changes to all synchronized nodes adds complexity. I made a webinar on a similar topic which was recorded and available for replay. Now I have found that I share a link to the webinar to my Support customers approximately once per week. Not having a good understanding of how schema change works in the cluster leads to lockups and operation failures. This talk will provide a checklist that will help to choose the best schema change method.
Presented at Percona Live Online: https://perconaliveonline2020.sched.com/event/ePm2/how-to-avoid-pitfalls-in-schema-upgrade-with-percona-xtradb-cluster
How to migrate from MySQL to MariaDB without tearsSveta Smirnova
Presented at MariaDB Server Fest 2020: https://mariadb.org/fest2020/migrate-mysql/
MariaDB is a drop-in replacement for MySQL. Initial migration is simple: start MariaDB over the old MySQL datadir.
Later your application may notice that some features work differently than with MySQL. These are MariaDB improvements, so this is good and, likely the reason you migrated.
In this session, I will focus on the differences affecting application performance and behavior. In particular, features sharing the same name, but working differently.
Modern solutions for modern database load: improvements in the latest MariaDB...Sveta Smirnova
Presented at MariaDB Server Fest 2020: https://mariadb.org/fest2020/improvements/
MariaDB is famous for working well in high-performance environments. But our view of what to call high-performance changes over time. Every year we get faster data transfer speed; more devices connected to the Internet; more users and, as a result, more data.
Challenges, which developers have to solve, are getting harder. This session shows what engineers do to keep the product up to date, focusing on MariaDB improvements that make it different from its predecessor, MySQL.
How Safe is Asynchronous Master-Master Setup?Sveta Smirnova
Presented at Percona MySQL Tech Day on September 10, 2020: https://www.percona.com/tech-days#mysql
It is common knowledge that built-in asynchronous active-active replication is not safe. I remember times when the official MySQL User Reference Manual stated that such an installation is not recommended for production use. Some experts repeat this claim even now.
While this statement is generally true, I worked with thousands of shops that successfully avoided asynchronous replication limitations in active-active setups.
In this talk, I will show how they did it, demonstrate situations when asynchronous source-source replication is the best possible high availability option and beats such solutions as Galera or InnoDB Clusters. I will also cover common mistakes, leading to disasters.
Современному хайлоду - современные решения: MySQL 8.0 и улучшения PerconaSveta Smirnova
MySQL всегда использовали под высокой нагрузкой. Недаром эта база была и остаётся самым популярным бэкэндом для web. Однако наши представления о хайлоде с каждым годом расширяются. Большая скорость передачи данных -> больше устройств с подключением к интернет -> больше пользователей -> больше данных.
Задачи, стоящие перед разработчиками MySQL, с каждым годом усложняются.
В этом докладе я расскажу как менялись сценарии использования MySQL за [почти] 25 лет её истории и что делали инженеры, чтобы MySQL оставалась актуальной. Мы затронем такие темы, как работа с большим количеством активных соединений и высокими объёмами данных. Я покажу насколько современные версии лучше справляются с возросшими нагрузками.
Я надеюсь, что после моего доклада те слушатели, которые используют старые версии, захотят обновиться и те, кто уже обновились, узнают как использовать современный MySQL на полную мощность.
Прочитана на конференции OST 2020: https://ostconf.com/materials/2857#2857
How Safe is Asynchronous Master-Master Setup?Sveta Smirnova
This document discusses the risks of using asynchronous master-master replication for MySQL databases and provides strategies for setting it up safely. It explains that having two nodes actively accepting writes can lead to conflicts like duplicate key errors. It recommends dividing writes across nodes by database, table, or row to avoid conflicts. The document also discusses using synchronous replication tools like Galera to ensure consistency across nodes at the cost of reduced performance.
Billion Goods in Few Categories: How Histograms Save a Life?Sveta Smirnova
We store data with an intention to use it: search, retrieve, group, sort... To do it effectively the MySQL Optimizer uses index statistics when compiles the query execution plan. This approach works excellently unless your data distribution is not even.
Last year I worked on several tickets where data follow the same pattern: millions of popular products fit into a couple of categories and rest used the rest. We had a hard time to find a solution for retrieving goods fast. We offered workarounds for version 5.7. However new MariaDB and MySQL 8.0 feature: histograms, - would work better, cleaner and faster. The idea of the talk was born.
Of course, histograms are not a panacea and do not help in all situations.
I will discuss:
how index statistics physically stored by the storage engine
which data exchanged with the Optimizer
why it is not enough to make correct index choice
when histograms can help and when they cannot
differences between MySQL and MariaDB histograms
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...Sveta Smirnova
Last year this session’s speaker worked on several cases where data followed the same pattern: millions of popular products fit into a couple of categories, and the rest uses the rest. Her team had a hard time finding a solution for retrieving goods quickly. MySQL 8.0 has a feature that resolves such issues: optimizer histograms, storing statistics of an exact number of values in each data bucket. In real life, histograms don’t help with all queries accessing nonuniform data. How you write a statement, the number of rows in the table, data distribution: All of these may affect the use of histograms. This presentation shows examples demonstrating how the optimizer works in each case, describes how to create histograms, and covers differences between MySQL and Oracle implementations.
Что нужно знать о трёх топовых фичах MySQLSveta Smirnova
MySQL прочно удерживает второе по популярности место после Oracle в рейтинге DB-engines: https://db-engines.com/en/ranking_trend Репликация, табличные движки и поддержка NoSQL не дают MySQL сдавать позиции с 2012 года: года основания рейтинга. Что особенного в этих фичах? Что нужно знать, чтобы использовать их на полную мощность?
Я расскажу про дизайн. Именно он отвечает за то, чтобы ваше приложение не достигло потолка производительности. Понимание архитектуры поможет при проектирование нового приложения, которое впоследствии будет легко масштабироваться.
Доклад рассчитан для начинающих пользователей MySQL. Однако поможет освежить свои знания и более опытным.
Billion Goods in Few Categories: How Histograms Save a Life?Sveta Smirnova
We store data with an intention to use it: search, retrieve, group, sort... To do it effectively, the MySQL Optimizer uses index statistics when it compiles the query execution plan. This approach works excellently unless your data distribution is not even.
Last year I worked on several support tickets where data follows the same pattern: millions of popular products fit into a couple of categories and the rest used the rest. We had a hard time finding a solution for retrieving goods fast. We offered workarounds for version 5.7. However, a new MariaDB and MySQL 8.0 feature - histograms - would work better, cleaner and faster. The idea of the talk was born.
Of course, histograms are not a panacea and do not help in all situations.
I will discuss
- how index statistics physically stored by the storage engine
- which data exchanged with the Optimizer
- why it is not enough to make correct index choice
- when histograms can help and when they cannot
- differences between MySQL and MariaDB histograms
Talk for Percona Live 2019 Austin: https://www.percona.com/live/19/sessions/billion-goods-in-few-categories-how-histograms-save-a-life
Performance Schema is a powerful diagnostic instrument for:
- Query performance
- Complicated locking issues
- Memory leaks
- Resource usage
- Problematic behavior, caused by inappropriate settings
- More
It comes with hundreds of options which allow precisely tuning what to instrument. More than 100 consumers store collected data.
In this tutorial, we will try all the important instruments out. We will provide a test environment and a few typical problems which could be hardly solved without Performance Schema. You will not only learn how to collect and use this information but have experience with it.
Tutorial at Percona Live Austin 2019
Optimizer Histograms: When they Help and When Do Not?Sveta Smirnova
Talk for pre-Fosdem MySQL Day on February 1, 2019.
Last year I worked on several tickets where data follow the same pattern: millions of popular products fit into a couple of categories and rest used the rest. We had a hard time to find a solution for retrieving goods fast.
MySQL 8.0 has a feature which resolves such issues: optimizer histograms, storing statistics of an exact number of values in each data bucket.
However in real life histograms help not with all queries, accessing non-uniform data. How you write a query, the number of rows in the table, data distribution: all these may affect the use of histograms.
In this session I show examples, demonstrating how Optimizer uses histograms.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
Trusted Execution Environment for Decentralized Process MiningLucaBarbaro3
Presentation of the paper "Trusted Execution Environment for Decentralized Process Mining" given during the CAiSE 2024 Conference in Cyprus on June 7, 2024.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
This presentation provides valuable insights into effective cost-saving techniques on AWS. Learn how to optimize your AWS resources by rightsizing, increasing elasticity, picking the right storage class, and choosing the best pricing model. Additionally, discover essential governance mechanisms to ensure continuous cost efficiency. Whether you are new to AWS or an experienced user, this presentation provides clear and practical tips to help you reduce your cloud costs and get the most out of your budget.
4. MySQL architecture
Connectors: C, JDBC, ODBC, Python, ...
Connection Pool: Authentication, Caches
SQL interface
Parser
Optimizer
Caches and Buffers:
Global
Engine-specific
Storage engines: InnoDB, TokuDB, ...
File system: Data, Index, logs, other files
• Base
• Installation layout
• Log files
• Connectors
• Clients, APIs
• Optimizer
• Cache and buffers
• Storage engines
• Management
4 www.percona.com
5. Typical installation layout
• datadir
• Schema directory
• Table and trigger files: *.frm, *.ibd, *.MYD,
*.par, etc.
• Schema
• ...
• InnoDB shared tablespace
• Log files
• InnoDB redo log files
• Binary, relay log files
• Error log
• Slow query log
• General query log
• Configurable
• You can setup
custom path for
each component
• Including custom
paths for tables
5 www.percona.com
6. Connectors for MySQL server
• Clients
• MySQL CLI
• MySQL Workbench
• Many other graphical and web-based
• APIs
• Exist for most popular programming languages
• C, C++, JDBC, PHP, Python, Net, ODBC, more
6 www.percona.com
7. Monitoring solutions
• Command-line
• Percona Toolkit
• MySQL Utilities
• With GUI
• MySQL Enterprise Monitor (MEM)
• MEM plugin for Oracle Enterprise Manager
• VividCortex
• Many others
7 www.percona.com
11. Error processing
• Warnings, errors, and notes
mysql> select max (f1) from t1;
ERROR 1630 (42000): FUNCTION test.max does not exist.
Check the ’Function Name Parsing and Resolution’ section
in the Reference Manual
mysql> select * from t1 where "f1"=1;
Empty set, 1 warning (0.05 sec)
mysql> show warnings;
+-----------+--------+----------------------------------------------------+
| Level | Code | Message |
+-----------+--------+----------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: ’f1’ |
+-----------+--------+----------------------------------------------------+
1 row in set (0.00 sec)
11 www.percona.com
12. Error handling in applications
• Error information
• mysql error
• mysql errno
• Warnings and notes
• mysql info
• mysql sqlstate
• mysql warning count
12 www.percona.com
13. Error handling in stored routines
• GET DIAGNOSTICS
• GET DIAGNOSTICS rows = ROW COUNT,
conditions = NUMBER;
• GET DIAGNOSTICS CONDITION 1 code =
RETURNED SQLSTATE, msg = MESSAGE TEXT;
• SIGNAL/RESIGNAL
• Can be used for custom errors
13 www.percona.com
14. More information about errors
[sveta@delly ~]$ perror 1630
MySQL error code 1630 (ER_FUNC_INEXISTENT_NAME_COLLISION):
FUNCTION %s does not exist. Check the ’Function Name Parsing and Resolution’
section in the Reference Manual
[sveta@delly ~]$ perror 1292
MySQL error code 1292 (ER_TRUNCATED_WRONG_VALUE):
Truncated incorrect %.32s value: ’%.128s’
[sveta@delly ~]$ perror 2
OS error code 2: No such file or directory
[sveta@delly ~]$ perror 150
MySQL error code 150: Foreign key constraint is incorrectly formed
14 www.percona.com
15. MySQL Access Privilege System
• No roles by default, limited user limits
• All records are in the mysql database (schema)
• Pluggable authentication since version 5.5
• Connections
• TCP/IP with login-password
• Socket (Unix)
• Named pipe (Windows)
15 www.percona.com
16. Common user access issues
• Privileged client cannot connect
• Unprivileged client can connect
• Privileged user cannot perform operation
• Unprivileged user has undesired access
16 www.percona.com
17. Common queries for access issues
mysql> select user, host from mysql.user order by user desc, host desc;
+------+------------+
| user | host |
+------+------------+
| root | localhost |
| root | delly |
| root | ::1 |
| root | 127.0.0.1 |
| foo | % |
| | localhost |
+------+------------+
6 rows in set (0.00 sec)
• Most descriptive host first, then wildcard
• Socket connection by default on Unix
17 www.percona.com
19. Wrong access example
mysql> show grants;
+--------------------------------------------------------------------+
| Grants for root@localhost |
+--------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO ’root’@’localhost’ WITH GRANT OPTION|
| GRANT PROXY ON ’’@’’ TO ’root’@’localhost’ WITH GRANT OPTION |
+--------------------------------------------------------------------+
2 rows in set (0.02 sec)
mysql> show grants for foo@’%’;
+-----------------------------------------------------+
| Grants for foo@% |
+-----------------------------------------------------+
| GRANT USAGE ON *.* TO ’foo’@’%’ |
| GRANT ALL PRIVILEGES ON ‘test‘.* TO ’foo’@’%’ |
+-----------------------------------------------------+
2 rows in set (0.02 sec)
19 www.percona.com
20. Connection statistics in P S
• Tables accounts, users, hosts
mysql> select user, host, current_connections as cur,
-> total_connections as total from performance_schema.accounts;
+------+-----------+-----+-------+
| user | host | cur | total |
+------+-----------+-----+-------+
| foo | localhost | 0 | 3 |
| root | localhost | 1 | 3 |
| NULL | NULL | 14 | 17 |
+------+-----------+-----+-------+
3 rows in set (0.01 sec)
• HOST CACHE
20 www.percona.com
21. Connection statistics in P S
• Tables accounts, users, hosts
• HOST CACHE
• Content of DNS cache
• Errors from:
• Name Server
• Connection
• Authentication
• max connect errors, max user errors, etc.
• Your first assistant in case of connection issue
20 www.percona.com
23. What can affect query execution?
• You run a query, it does not return an error, but still
behaves not as expected
• It can be:
• Startup options or system variables
• How optimizer creates query plan
• Storage engine used
• Parallel execution - next big section
22 www.percona.com
24. System variables and options: scope
• Global
• Control parameters, necessary for all server
processes
• Location of server files: datadir etc.
• Shared buffers
• More
• Session
• Control connection-specific parameters
• MySQL option tables
23 www.percona.com
25. System Variables: how to set
• SET [GLOBAL] var name = NEW VAL
• Command-line option
• Configuration file
• In default location
• Specified by option –defaults-file
24 www.percona.com
26. System Variables: who can change
• Global options and few session options
• A user with privilege SUPER
• Session options
• Anybody
• There are no limits!
25 www.percona.com
27. Buffers: when allocated
• Those which control behavior of whole server
• Once at server startup
• Can start with low values, then grow to specified
• Connection options
• For every connection when connection opens
• Operation-specific
• For every operation when needed
• Can be allocated more than once per query
26 www.percona.com
28. System variables: control before 5.7
• SHOW [GLOBAL] STATUS
• Tables in Information Schema
• GLOBAL ,SESSION VARIABLES
• GLOBAL ,SESSION STATUS
• GLOBAL
• Since server start
• SESSION
• For operations in current session
• Can be reset
• FLUSH STATUS
27 www.percona.com
29. System status variables: example
mysql> show global status like ’Handler_read_rnd_next’G
*************************** 1. row ***************************
Variable_name: Handler_read_rnd_next
Value: 27
1 row in set (0.00 sec)
mysql> show status like ’Handler_read_rnd_next’G
*************************** 1. row ***************************
Variable_name: Handler_read_rnd_next
Value: 7
1 row in set (0.00 sec)
28 www.percona.com
30. Information Schema
• Contains metadata information
• Tables
• Indexes
• Other
• Allows to create plugins
• InnoDB plugins
• Similar to Data Dictionary Views in Oracle
29 www.percona.com
31. System variables: control in 5.7
• Performance Schema tables
• variabes by*
• user variables by*
• status by*
• Statistics grouped by
• Global
• Session
• Thread
• Account/Host/User
30 www.percona.com
32. System variables: best practices
• Record currently used variables
• SHOW [GLOBAL] VARIABLES
• Make change dynamically if possible
• SET [GLOBAL] var name=NEW VAL
• Test in one session first
• Then change global variable
• Change configuration file after you are happy with
results
31 www.percona.com
33. When affecting option is not known
• Record currently used variables
• SHOW [GLOBAL] VARIABLES
• Start mysqld with option –no-defaults
• This option must be first one!
• Check if problem is solved
• Change variable values one-by-one until you find one
which leads to the problem
32 www.percona.com
34. MySQL Optimizer
• EXPLAIN is less powerful if compare with Oracle
• Visual EXPLAIN in MySQL Workbench
• EXPLAIN EXTENDED
• Should be followed by SHOW WARNINGS
• EXPLAIN PARTITIONS
• EXPLAIN FORMAT=JSON
• INFORMATION SCHEMA.TRACE
• Status variables ’Handler %’
33 www.percona.com
35. EXPLAIN in Oracle
• http://docs.oracle.com/cd/B10500_01/server.
920/a96533/ex_plan.htm
EXPLAIN PLAN SET statement_id = ’example_plan4’ FOR
SELECT h.order_number, l.revenue_amount, l.ordered_quantity
FROM so_headers_all h, so_lines_all l
WHERE h.customer_id = :b1
AND h.date_ordered > SYSDATE30
AND l.header_id = h.header_id ;
Plan
--------------------------------------------------
SELECT STATEMENT
NESTED LOOPS
TABLE ACCESS BY INDEX ROWID SO_HEADERS_ALL
INDEX RANGE SCAN SO_HEADERS_N1
TABLE ACCESS BY INDEX ROWID SO_LINES_ALL
INDEX RANGE SCAN SO_LINES_N1
34 www.percona.com
36. EXPLAIN in MySQL
mysql> EXPLAIN EXTENDED SELECT user, host FROM mysql.userG
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: user
type: index
possible_keys: NULL
key: PRIMARY
key_len: 228
ref: NULL
rows: 4
filtered: 100.00
Extra: Using index
1 row in set, 1 warning (0.00 sec)
mysql> SHOW WARNINGSG
******* 1. row *******
Level: Note
Code: 1003
Message: /* select#1 */ select ‘mysql‘.‘user‘.‘User‘ AS ‘user‘, ‘mysql‘.‘user‘.‘Host‘ AS ‘host‘ from ‘mys
35 www.percona.com
37. EXPLAIN: overview
mysql> explain extended select * from t1 join t2 where t1.int_key=1;
+----+-------------+-------+-------+---------------+---------+---------+-------+------+------+-----------
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | f... | Extra
+----+-------------+-------+-------+---------------+---------+---------+-------+------+------+-----------
| 1 | SIMPLE | t1 | ref | int_key,ik | int_key | 5 | const | 4 | 100. | NULL
| 1 | SIMPLE | t2 | index | NULL | pk | 9 | NULL | 6 | 100. | Using inde
Using join
(Block Nes
+----+-------------+-------+-------+---------------+---------+---------+-------+------+------+-----------
2 rows in set, 1 warning (0.00 sec)
Note (Code 1003): /* select#1 */ select ‘test‘.‘t1‘.‘pk‘ AS ‘pk‘,‘test‘.‘t1‘.‘int_key‘ AS ‘int_key‘,‘test
AS ‘pk‘,‘test‘.‘t2‘.‘int_key‘ AS ‘int_key‘ from ‘test‘.‘t1‘ join ‘test‘.‘t2‘ where (‘test‘.‘t1‘.‘int_key‘
Number of select
Select type
Tables, for which information is printed
How data is accessed
Possible keys
Key, which was actually used
Length of the key
Which columns were compared with the index
Number of examined rows
% of filtered rows
rows x filtered / 100 — number of rows,
which will be joined with another table
Additional information
Table, for which information is printed
Product of rows here: how many rows in all tables will be accessed
For this example estimated value is 4*6 = 24
Actual (optimized) query as executed by MySQL Server
36 www.percona.com
39. When EXPLAIN lies: Handler % variables
mysql> flush status;
Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from employees join titles using(emp_no)
-> where title=’Senior Engineer’G
*************************** 1. row ***************************
count(*): 97750
1 row in set (3.24 sec)
mysql> SHOW STATUS LIKE ’Handler_read_%’;
+----------------------------+--------+
| Variable_name | Value |
+----------------------------+--------+
| Handler_read_first | 1 |
| Handler_read_key | 300027 |
| Handler_read_last | 0 |
| Handler_read_next | 397774 |
...
38 www.percona.com
40. MySQL Optimizer: other tools
• INFORMATION SCHEMA.OPTIMIZER TRACE
• join preparation, join optimization, join execution
• considered execution plans, refine plan, more
• Query Analyzer in MEM
• Visual EXPLAIN in MySQL Workbench
39 www.percona.com
41. MySQL Storage Engines
• Own way to handle
• Corruption
• Index statistics
• CHECK TABLE to check for errors
• They care about physical data, so all data information is
on their level
• Options usually start from engine name
• myisam *, innodb *, custom *
40 www.percona.com
44. Storage Engines explained
• InnoDB
• Own locking model: row-based
• Troubleshooting tools
• InnoDB Monitors (SHOW ENGINE InnoDB STATUS)
• Tables in Information Schema
• Instrumentation in Performance Schema
41 www.percona.com
45. Storage Engines explained
• TokuDB
• Fractal tree
• Optimized for compression and writes
• Troubleshooting tools
• SHOW ENGINE tokudb STATUS
• Information schema tables
• Status variables
41 www.percona.com
46. Storage Engines explained
• Popular non-transactional engines
• Server provides locking model
• Table-level locks
• Can have own instrumentation
• MyISAM
• Status variables
• Performance Schema
• Set of utilities, names start from myisam *
41 www.percona.com
48. Common concurrency issues
• Query or transaction waits a lock, held by another one
• Fight for system resources
• Resource overload
• Resource underload
43 www.percona.com
53. Locks diagnostic
• SHOW ENGINE INNODB STATUS
-------------
TRANSACTIONS
-------------
Trx id counter 0 26243837
Purge done for trx’s n:o < 0 26243834 undo n:o < 0 0
History list length 2
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 26243836, ACTIVE 4 sec, OS thread id 101514240 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 320, 1 row lock(s)
MySQL thread id 4485, query id 25022137 localhost root Updating
update t set a=36 where a=6
45 www.percona.com
54. InnoDB Monitors
• SHOW ENGINE INNODB STATUS
• Permanent output
• innodb status output
• innodb status output locks
• innodb-status-file - Deleted on normal shutdown!
46 www.percona.com
58. MySQL Replication Overview
• Always available, needs to be setup
• Asynchronous master-slave
• Master
• Keeps all updates in binary log file
• Two formats: ROW and STATEMENT
• Slave
• IO thread read updates from master and stores in
relay log file
• SQL thread executes updates
• Multiple SQL threads since 5.6
• Multiple masters since 5.7
• GTIDs since 5.6
50 www.percona.com
59. Main troubleshooting tools
• SHOW SLAVE STATUS
• Tables in Performance Schema and system database
• Multi-threaded slave (MTS) has additional output for
each worker
• Error log file
51 www.percona.com
60. Main troubleshooting tools
• SHOW SLAVE STATUS
mysql> show slave status G
************************ 1. row ************************
Slave_IO_State: Queueing master event to the relay log
...
Master_Log_File: master-bin.000003
Read_Master_Log_Pos: 191
Relay_Log_File: slave-relay-bin.000006
Relay_Log_Pos: 4
Relay_Master_Log_File: master-bin.000002
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
...
Last_Errno: 0
Last_Error:
...
Exec_Master_Log_Pos: 319
...
51 www.percona.com
61. Main troubleshooting tools
• Tables in Performance Schema and system database
• replication connection configuration
• replication applier configuration
• replication connection status
• replication applier status
• replication applier status by coordinator
• replication applier status by worker - MTS only
• mysql.slave master info
• mysql.slave relay log info
• mysql.slave worker info
51 www.percona.com
63. IO thread: communication issues
• Check slave error log
• SHOW SLAVE STATUS
• P S.replication connection status
• Access error
• Try to connect using normal MySQL client using
slave credentials
• SHOW GRANTS
• Fix privileges on master
• Restart slave
52 www.percona.com
64. SQL thread: typical issues
• Simple master-slave
• Data is different on master and slave
• Replication event can not be applied
• Different errors on master and slave
• Slave lags far behind the master
• Circular replication or other writes in addition to slave
SQL thread
• Data is different on master and slave
53 www.percona.com
65. Data is different on master and slave
• Was the table modified besides the SQL thread?
• How?
• Can it affect content of the table in the wrong way?
• Are the table definitions same on master and slave?
• MySQL Utilities
• mysqlrplsync, mysqldbcompare, mysqldiff
• Maybe master events were applied in wrong order?
• Use mysqlbinlog to find queries caused the issue
• Check application, running on master
54 www.percona.com
66. Events applied in different order
• Happens only with STATEMENT format
• Row lock issues
• Triggers
• SET GLOBAL slave skip counter - No GTIDs!
• Skip transaction - GTIDs
• Synchronize tables!
• Different options
• Start slave with master’s options, then check
• Happens in older versions
55 www.percona.com
67. Slave lags behind master
• Threads
• Master runs in multiple update threads
• Slave uses single
• Seconds behind master is growing - Not 100 % reliable!
• Tune slave performance
• Multi-threaded slave
• One thread per database in 5.6
• Affected by concurrency issues
• Indexes on slave only
• For statement-based replication
56 www.percona.com
69. Further reading
• MySQL Troubleshooting book
• Planet MySQL
• MySQL User Reference Manual
• Bug trackers
• http://bugs.mysql.com
• https://bugs.launchpad.net/percona-server/
58 www.percona.com