This is the final part of our webinar trilogy on MySQL Query Tuning, in which we looked at query tuning process and tools to help with that. We’ve covered topics such as SQL tuning, indexing, the optimizer and how to leverage EXPLAIN to gain insight into execution plans. Part 3: Working with the optimizer and SQL tuning.
AGENDA
Optimizer
- How execution plans are calculated
- InnoDB statistics
Hinting the optimizer
- Index hints
- JOIN order modifications
- Tweakable optimizations
Optimizing SQL
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Webinar slides: MySQL Query Tuning Trilogy: Indexing and EXPLAIN - deep diveSeveralnines
This is part 2 of our webinar trilogy on MySQL Query Tuning, in which we look at query tuning process and tools to help with that. We’ve covered topics such as SQL tuning, indexing, the optimizer and how to leverage EXPLAIN to gain insight into execution plans. Part 2: Indexing and EXPLAIN - deep dive.
AGENDA
How B-Tree indexes are built?
Indexes - MyISAM vs. InnoDB
Different index types
- B-Tree
- Fulltext
- Hash
Indexing gotchas
EXPLAIN walkthrough - query execution plan
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Webinar replay: MySQL Query Tuning Trilogy: Query tuning process and toolsSeveralnines
This is part 1 of a webinar trilogy on MySQL Query Tuning, in which we look at query tuning process and tools to help with that. We’ve covered topics such as SQL tuning, indexing, the optimizer and how to leverage EXPLAIN to gain insight into execution plans. Part 1: Query tuning process and tools.
AGENDA
• Query tuning process
- Build
- Collect
- Analyze
- Tune
- Test
• Tools
- tcpdump
- pt-query-digest
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Optimising your Amazon Redshift Cluster for Peak PerformanceAmazon Web Services
In this session, we take an in-depth look at the latest features in Amazon Redshift. Analyze data stored in and outside of your cluster with Amazon Redshift Spectrum, accelerate all your analytics workloads, and modernize your on-premises data warehouse. We will focus on best practices for designing optimal schemas, load data efficiently, and optimise queries to deliver high throughput an performance.
Speaker: Ganesh Raja, Solutions Architect, AWS
This talk will be an overview of the new features and improvements currently implemented for the Apache Accumulo 1.8.0 release. This will be a discussion about some of these exciting changes with a focus on what is of the most importance for users.
Webinar slides: MySQL Query Tuning Trilogy: Indexing and EXPLAIN - deep diveSeveralnines
This is part 2 of our webinar trilogy on MySQL Query Tuning, in which we look at query tuning process and tools to help with that. We’ve covered topics such as SQL tuning, indexing, the optimizer and how to leverage EXPLAIN to gain insight into execution plans. Part 2: Indexing and EXPLAIN - deep dive.
AGENDA
How B-Tree indexes are built?
Indexes - MyISAM vs. InnoDB
Different index types
- B-Tree
- Fulltext
- Hash
Indexing gotchas
EXPLAIN walkthrough - query execution plan
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Webinar replay: MySQL Query Tuning Trilogy: Query tuning process and toolsSeveralnines
This is part 1 of a webinar trilogy on MySQL Query Tuning, in which we look at query tuning process and tools to help with that. We’ve covered topics such as SQL tuning, indexing, the optimizer and how to leverage EXPLAIN to gain insight into execution plans. Part 1: Query tuning process and tools.
AGENDA
• Query tuning process
- Build
- Collect
- Analyze
- Tune
- Test
• Tools
- tcpdump
- pt-query-digest
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Optimising your Amazon Redshift Cluster for Peak PerformanceAmazon Web Services
In this session, we take an in-depth look at the latest features in Amazon Redshift. Analyze data stored in and outside of your cluster with Amazon Redshift Spectrum, accelerate all your analytics workloads, and modernize your on-premises data warehouse. We will focus on best practices for designing optimal schemas, load data efficiently, and optimise queries to deliver high throughput an performance.
Speaker: Ganesh Raja, Solutions Architect, AWS
This talk will be an overview of the new features and improvements currently implemented for the Apache Accumulo 1.8.0 release. This will be a discussion about some of these exciting changes with a focus on what is of the most importance for users.
Cost-based Query Optimization in Apache Phoenix using Apache CalciteJulian Hyde
This talk, given by Maryann Xue and Julian Hyde at Hadoop Summit, San Jose on June 30th, 2016, describes how we re-engineered Apache Phoenix with a cost-based optimizer based on Apache Calcite.
Apache Phoenix has rapidly become a workhorse in many organizations, providing a convenient standard SQL interface to HBase suitable for a wide variety of workloads from transactions to ETL and analytics. But Phoenix's initial query optimizer was based on static optimization procedures and thus could not choose between several potential plans or indices based on cost metrics.
We describe how we rebuilt Phoenix's parser and query optimizer using the Calcite framework, improving Phoenix's performance and SQL compliance. The new architecture uses relational algebra as an intermediate language, and this enables you to switch in other engines, especially those also based on Calcite. As an example of this, we demonstrate querying a Phoenix database via Apache Drill.
Optimizing Your Amazon Redshift Cluster for Peak Performance - AWS Summit Syd...Amazon Web Services
Optimising Your Amazon Redshift Cluster for Peak Performance
In this session we take an in-depth look at the latest features in Amazon Redshift, including analysing data store in and outside of your cluster with Amazon Redshift Spectrum, query and platform enhancements, and more. We will dive deep into best practices on how to design optimal schemas, load data efficiently, and optimise your queries to deliver high throughput and performance.
Eric Ferreira , Principal Database Engineer, Amazon Web Services
Cost-based query optimization in Apache Hive 0.14Julian Hyde
Tez is making Hive faster, and now cost-based optimization (CBO) is making it smarter. A new initiative in Hive introduces cost-based optimization for the first time, based on the Optiq framework. Optiq's lead developer Julian Hyde shows the improvements that CBO is bringing in Apache Hive 0.14.
For those interested in Hive internals, he gives an overview of the Optiq framework and shows some of the improvements that are coming to future versions of Hive with the Stinger.next initiative.
Apache phoenix: Past, Present and Future of SQL over HBAseenissoz
HBase as the NoSQL database of choice in the Hadoop ecosystem has already been proven itself in scale and in many mission critical workloads in hundreds of companies. Phoenix as the SQL layer on top of HBase, has been increasingly becoming the tool of choice as the perfect complementary for HBase. Phoenix is now being used more and more for super low latency querying and fast analytics across a large number of users in production deployments. In this talk, we will cover what makes Phoenix attractive among current and prospective HBase users, like SQL support, JDBC, data modeling, secondary indexing, UDFs, and also go over recent improvements like Query Server, ODBC drivers, ACID transactions, Spark integration, etc. We will conclude by looking into items in the pipeline and how Phoenix and HBase interacts with other engines like Hive and Spark.
Strongly Consistent Global Indexes for Apache PhoenixYugabyteDB
Presentation by Kadir Ozdemir, Principal Architect - Salesforce, recorded at Distributed SQL Summit on Sept 20, 2019.
https://vimeo.com/362358494
distributedsql.org/
How do you get data from your sources into your Redshift data warehouse? We'll show how to use AWS Glue and Amazon Kinesis Firehose to make it easy to automate the work to get data loaded.
Speakers:
Natalie Rabinovich- Solutions Architect, AWS
Gareth Eagar - Solutions Architect, AWS
Data Analytics Week at the San Francisco Loft
Loading Data Into Redshift
How do you get data from your sources into your Redshift data warehouse? We'll show how to use AWS Glue and Amazon Kinesis Firehose to make it easy to automate the work to get data loaded.
Speakers:
Jay Formosa - Solutions Architect, AWS
Asser Moustafa - Data Warehouse Specialist Solutions Architect, AWS
Apache Phoenix and Apache HBase: An Enterprise Grade Data WarehouseJosh Elser
An overview of Apache Phoenix and Apache HBase from the angle of a traditional data warehousing solution. This talk focuses on where this open-source architect fits into the market outlines the features and integrations of the product, showing that it is a viable alternative to traditional data warehousing solutions.
Introduction to Apache Calcite. An overview of the core features that Apache Calcite provides to help build a database. The talk covers Calcite's SQL parser, cost-based optimizer, pluggable data sources, and JDBC-HTTP server "Avatica".
(DAT311) Large-Scale Genomic Analysis with Amazon RedshiftAmazon Web Services
Genomics analysis is one of the biggest data problems out there. With DNA sequencing finally down to an affordable cost, the current bottleneck is shifting from sequencing genomes to deriving meaning from genomes at a large scale. Learn how Human Longevity, Inc., uses Amazon Redshift to analyze thousands of whole genomes every month. Dive into their detailed architecture, including how they ingest terabytes of genomic information each day. Learn how they optimize their schema, rapidly analyzing thousands of genomes in a single query using a "select, aggregate, annotate" paradigm. Finally, learn best practices for using Amazon Redshift to accelerate research.
Apache Phoenix’s relational database view over Apache HBase delivers a powerful tool which enables users and developers to quickly and efficiently access their data using SQL. However, Phoenix only provides a Java client, in the form of a JDBC driver, which limits Phoenix access to JVM-based applications. The Phoenix QueryServer is a standalone service which provides the building blocks to use Phoenix from any language, not just those running in a JVM. This talk will serve as a general purpose introduction to the Phoenix QueryServer and how it complements existing Apache Phoenix applications. Topics covered will range from design and architecture of the technology to deployment strategies of the QueryServer in production environments. We will also include explorations of the new use cases enabled by this technology like integrations with non-JVM based languages (Ruby, Python or .NET) and the high-level abstractions made possible by these basic language integrations.
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Severalnines
You’re running MySQL as backend database, how do you tune it to make best use of the hardware? How do you optimize the Operating System? How do you best configure MySQL for a specific database workload?
Do these questions sound familiar to you? Maybe you’re having to deal with that type of situation yourself?
In this webinar, we’ve discussed some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL database. We also covered some of the variables which are frequently modified even though they should not. Performance tuning is not easy, but you can go a surprisingly long way with a few basic guidelines.
AGENDA
Database tuning - the what and why
Principles of the tuning process
Tuning the Operating System configuration
Tuning the MySQL configuration
Useful tools
pt-summary
pt-mysql-summary
What to avoid when tuning OS and MySQL configuration
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
This webinar is based on our popular blog series ‘Become a MySQL DBA’.
Cost-based Query Optimization in Apache Phoenix using Apache CalciteJulian Hyde
This talk, given by Maryann Xue and Julian Hyde at Hadoop Summit, San Jose on June 30th, 2016, describes how we re-engineered Apache Phoenix with a cost-based optimizer based on Apache Calcite.
Apache Phoenix has rapidly become a workhorse in many organizations, providing a convenient standard SQL interface to HBase suitable for a wide variety of workloads from transactions to ETL and analytics. But Phoenix's initial query optimizer was based on static optimization procedures and thus could not choose between several potential plans or indices based on cost metrics.
We describe how we rebuilt Phoenix's parser and query optimizer using the Calcite framework, improving Phoenix's performance and SQL compliance. The new architecture uses relational algebra as an intermediate language, and this enables you to switch in other engines, especially those also based on Calcite. As an example of this, we demonstrate querying a Phoenix database via Apache Drill.
Optimizing Your Amazon Redshift Cluster for Peak Performance - AWS Summit Syd...Amazon Web Services
Optimising Your Amazon Redshift Cluster for Peak Performance
In this session we take an in-depth look at the latest features in Amazon Redshift, including analysing data store in and outside of your cluster with Amazon Redshift Spectrum, query and platform enhancements, and more. We will dive deep into best practices on how to design optimal schemas, load data efficiently, and optimise your queries to deliver high throughput and performance.
Eric Ferreira , Principal Database Engineer, Amazon Web Services
Cost-based query optimization in Apache Hive 0.14Julian Hyde
Tez is making Hive faster, and now cost-based optimization (CBO) is making it smarter. A new initiative in Hive introduces cost-based optimization for the first time, based on the Optiq framework. Optiq's lead developer Julian Hyde shows the improvements that CBO is bringing in Apache Hive 0.14.
For those interested in Hive internals, he gives an overview of the Optiq framework and shows some of the improvements that are coming to future versions of Hive with the Stinger.next initiative.
Apache phoenix: Past, Present and Future of SQL over HBAseenissoz
HBase as the NoSQL database of choice in the Hadoop ecosystem has already been proven itself in scale and in many mission critical workloads in hundreds of companies. Phoenix as the SQL layer on top of HBase, has been increasingly becoming the tool of choice as the perfect complementary for HBase. Phoenix is now being used more and more for super low latency querying and fast analytics across a large number of users in production deployments. In this talk, we will cover what makes Phoenix attractive among current and prospective HBase users, like SQL support, JDBC, data modeling, secondary indexing, UDFs, and also go over recent improvements like Query Server, ODBC drivers, ACID transactions, Spark integration, etc. We will conclude by looking into items in the pipeline and how Phoenix and HBase interacts with other engines like Hive and Spark.
Strongly Consistent Global Indexes for Apache PhoenixYugabyteDB
Presentation by Kadir Ozdemir, Principal Architect - Salesforce, recorded at Distributed SQL Summit on Sept 20, 2019.
https://vimeo.com/362358494
distributedsql.org/
How do you get data from your sources into your Redshift data warehouse? We'll show how to use AWS Glue and Amazon Kinesis Firehose to make it easy to automate the work to get data loaded.
Speakers:
Natalie Rabinovich- Solutions Architect, AWS
Gareth Eagar - Solutions Architect, AWS
Data Analytics Week at the San Francisco Loft
Loading Data Into Redshift
How do you get data from your sources into your Redshift data warehouse? We'll show how to use AWS Glue and Amazon Kinesis Firehose to make it easy to automate the work to get data loaded.
Speakers:
Jay Formosa - Solutions Architect, AWS
Asser Moustafa - Data Warehouse Specialist Solutions Architect, AWS
Apache Phoenix and Apache HBase: An Enterprise Grade Data WarehouseJosh Elser
An overview of Apache Phoenix and Apache HBase from the angle of a traditional data warehousing solution. This talk focuses on where this open-source architect fits into the market outlines the features and integrations of the product, showing that it is a viable alternative to traditional data warehousing solutions.
Introduction to Apache Calcite. An overview of the core features that Apache Calcite provides to help build a database. The talk covers Calcite's SQL parser, cost-based optimizer, pluggable data sources, and JDBC-HTTP server "Avatica".
(DAT311) Large-Scale Genomic Analysis with Amazon RedshiftAmazon Web Services
Genomics analysis is one of the biggest data problems out there. With DNA sequencing finally down to an affordable cost, the current bottleneck is shifting from sequencing genomes to deriving meaning from genomes at a large scale. Learn how Human Longevity, Inc., uses Amazon Redshift to analyze thousands of whole genomes every month. Dive into their detailed architecture, including how they ingest terabytes of genomic information each day. Learn how they optimize their schema, rapidly analyzing thousands of genomes in a single query using a "select, aggregate, annotate" paradigm. Finally, learn best practices for using Amazon Redshift to accelerate research.
Apache Phoenix’s relational database view over Apache HBase delivers a powerful tool which enables users and developers to quickly and efficiently access their data using SQL. However, Phoenix only provides a Java client, in the form of a JDBC driver, which limits Phoenix access to JVM-based applications. The Phoenix QueryServer is a standalone service which provides the building blocks to use Phoenix from any language, not just those running in a JVM. This talk will serve as a general purpose introduction to the Phoenix QueryServer and how it complements existing Apache Phoenix applications. Topics covered will range from design and architecture of the technology to deployment strategies of the QueryServer in production environments. We will also include explorations of the new use cases enabled by this technology like integrations with non-JVM based languages (Ruby, Python or .NET) and the high-level abstractions made possible by these basic language integrations.
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Severalnines
You’re running MySQL as backend database, how do you tune it to make best use of the hardware? How do you optimize the Operating System? How do you best configure MySQL for a specific database workload?
Do these questions sound familiar to you? Maybe you’re having to deal with that type of situation yourself?
In this webinar, we’ve discussed some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL database. We also covered some of the variables which are frequently modified even though they should not. Performance tuning is not easy, but you can go a surprisingly long way with a few basic guidelines.
AGENDA
Database tuning - the what and why
Principles of the tuning process
Tuning the Operating System configuration
Tuning the MySQL configuration
Useful tools
pt-summary
pt-mysql-summary
What to avoid when tuning OS and MySQL configuration
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
This webinar is based on our popular blog series ‘Become a MySQL DBA’.
15 Ways to Kill Your Mysql Application Performanceguest9912e5
Jay is the North American Community Relations Manager at MySQL. Author of Pro MySQL, Jay has also written articles for Linux Magazine and regularly assists software developers in identifying how to make the most effective use of MySQL. He has given sessions on performance tuning at the MySQL Users Conference, RedHat Summit, NY PHP Conference, OSCON and Ohio LinuxFest, among others.In his abundant free time, when not being pestered by his two needy cats and two noisy dogs, he daydreams in PHP code and ponders the ramifications of __clone().
Webinar slides: Top 9 Tips for building a stable MySQL Replication environmentSeveralnines
MySQL replication is a widely known and proven solution to build scalable clusters of databases. It is very easy to deploy, even easier with GTID. Easy deployment doesn't mean you don't need knowledge and skills to operate it correctly. If you'd like to learn what is needed to build a stable environment using MySQL replication, this webinar is for you.
AGENDA
1. Sanity checks before migrating into MySQL replication setup
2. Operating system configuration
3. Replication
4. Backup
5. Provisioning
6. Performance
7. Schema changes
8. Reporting
9. Disaster recovery
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019Dave Stokes
How well are you taking care of your database? Well, if you paycheck depends on your database you will want to make sure that you are not making these mistakes.
The presentation helps to introduce the key aspects of the Oracle Optimizer and how you find out what it's up to and how you can influence its decisions.
Need a preview of the exciting new features added to MySQL 8.0? Better Unicode support, better JSON and document handling. Find out what else did we improve in MySQL 8.0. Get the presentation on MySQL server 8.0.
DIY DBaaS: A guide to building your own full-featured DBaaSSeveralnines
More so than ever, businesses need to ensure that their databases are resilient, secure, and always available to support their operations. Database-as-a-Service (DBaaS) solutions have become a popular way for organizations to manage their databases efficiently, leveraging cloud infrastructure and advanced set-and-forget automation.
However, consuming DBaaS from providers comes with many compromises. In this guide, we’ll show you how you can build your own flexible DBaaS, your way. We’ll demonstrate how it is possible to get the full spectrum of DBaaS capabilities along with workload access and portability, and avoid surrendering control to a third-party.
From architectural and design considerations to operational requirements, we’ll take you through the process step-by-step, providing all the necessary information and guidance to help you build a DBaaS solution that is tailor-made to your unique use case. So get ready to dive in and learn how to build your own custom DBaaS solution from scratch!
We created this guide to help developers understand:
- Traditional vs. Sovereign DBaaS implementation models
- The DBaaS environment, elements and design principles
- Using a Day 2 operations framework to develop your blueprint
- The 8 key operations that form the foundation of a complete DBaaS
- Bringing the Day 2 ops framework to life with a provisional architecture
- How you can abstract the orchestration layer with Severalnines solutions
Cloud's future runs through Sovereign DBaaSSeveralnines
Sovereign DBaaS is a new way to do DBaaS that allows you to reliably scale your open-source database ops without being limited to a specific environment or ceding control of your infrastructure to third-party service providers.
With Sovereign DBaaS, users can leverage the benefits of modern deployment strategies, e.g. public cloud, hybrid, etc., with additional security, compliance, and risk mitigation. So what exactly is Sovereign DBaaS and why should you choose one?
Presented by Sanjeev Mohan, Principal Analyst at SanjMo and former Gartner Research VP, and Vinay Joosery, CEO of Severalnines, this webinar dives into the future of the cloud and database management and introduces a new solution, Sovereign DBaaS.
The state of the cloud and its current challenges
What is Sovereign DBaaS?
Agenda:
- Key features of Sovereign DBaaS
- Why you should choose a Sovereign DBaaS
- How you can implement Sovereign DBaaS with Severalnines
- Q&A
Tips to drive maria db cluster performance for nextcloudSeveralnines
Nextcloud requires a database to store administrative data for the platform. A poorly performing database can have a serious impact on performance and availability of Nextcloud. MariaDB Cluster is the recommended database backend for production installations that require high availability and performance.
This talk is a deep dive into how to design and optimize MariaDB Galera Cluster for Nextcloud. We will cover 5 tips on how to significantly improve performance and stability.
Agenda:
Overview of Nextcloud architecture
Database architecture design
Database proxy
MariaDB and InnoDB performance tuning
Nextcloud performance tuning
Q&A
Working with the Moodle Database: The BasicsSeveralnines
Managing the database behind Moodle is key to improving performance and achieving uptime for your users. In this training video we will talk about the Moodle database including topics like configuration, monitoring, and schema management as well as show you how ClusterControl can help with the management of your eLearning LMS systems.
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSeveralnines
Are you an SysAdmin who is now responsible for your companies database operations? Then this is the webinar for you. Learn from a Senior DBA the basics you need to know to keep things up-and-running and how automation can help.
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...Severalnines
Over the past few years, VidaXL has become a European market leader in the online retail of slow moving consumer goods. When a company achieved over 50% year over year growth for the past 9 years, there is hardly enough time to overhaul existing systems. This means existing systems will be stretched to the maximum of their capabilities, and often additional performance will be gained by utilizing a large variety of datastores.
Webinar slides: How to Migrate from Oracle DB to MariaDBSeveralnines
Watch this webinar replay as we walk you through all you need to know to plan and execute a successful migration from Oracle database to MariaDB.
Over the years MariaDB has gained Enterprise support and maturity to run critical and complex data transaction systems. With the recent version, MariaDB has added some great new features such as SQL_Mode=Oracle compatibility, making the transition process easier than ever before.
Whether you’re planning to migrate from Oracle database to MariaDB manually or with the help of a commercial tool to automate the entire migration process, you need to know all the possible bottlenecks and methods involved in the process and the results validation.
Migrating from Oracle database to MariaDB can come with a number of benefits: lower cost of ownership, access to and use of an open source database engine, tight integration with the web, wide circle of MariaDB database professionals and more.
Find out how it could benefit your organisation!
AGENDA
- A brief introduction to the platform
- Oracle vs MariaDB
- Platform support
- Installation process
- Database access
- Backup process
- Controlling query execution
- Security
- Replication options
- Migration
- Planning and development strategy
- Assessment or preliminary check
- Data type mapping
- Migration tools
- Migration process
- Testing
- Post-migration
- Monitoring and Alerting
- Performance Management
- Backup Management
- High availability
- Upgrades
- Scaling
- Staff training
SPEAKER
Bartlomiej Oles, Senior Support Engineer at Severalnines, is a MySQL and Oracle DBA, with over 15 years experience in managing highly available production systems at IBM, Nordea Bank, Acxiom, Lufthansa, and other Fortune 500 companies. In the past five years, his focus has been on building and applying automation tools to manage multi-datacenter database environments.
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlSeveralnines
Running PostgreSQL in production comes with the responsibility for a business critical environment; this includes high availability, disaster recovery, and performance. Ops staff worry whether databases are up and running, if backups are taken and tested for integrity, whether there are performance problems that might affect end user experience, if failover will work properly in case of server failure without breaking applications, and the list goes on.
ClusterControl can be used to operationalize your PostgreSQL footprint across your enterprise. It offers a standard way of deploying high-availability replication setups with auto-failover, integrated with load balancers offering a single endpoint to applications. It provides constant health and performance monitoring through rich dashboards, as well as backup management and point-in-time recovery
See how much time and effort can be saved, as well as risks mitigated, with the help of a unified management platform over the more traditional, manual methods.
We’ve seen a 152% increase in ClusterControl installations by PostgreSQL users last year, so make sure you don’t miss out on the trend!
AGENDA
- Managing PostgreSQL “the old way”:
- Common challenges
- Important tasks to perform
- Tools that are available to help
- PostgreSQL automation and management with ClusterControl:
- Deployment
- Backup and recovery
- HA setups
- Failover
- Monitoring
- Live Demo
SPEAKER
Sebastian Insausti, Support Engineer at Severalnines, has loved technology since his childhood, when he did his first computer course (Windows 3.11). And from that moment he was decided on what his profession would be. He has since built up experience with MySQL, PostgreSQL, HAProxy, WAF (ModSecurity), Linux (RedHat, CentOS, OL, Ubuntu server), Monitoring (Nagios), Networking and Virtualization (VMWare, Proxmox, Hyper-V, RHEV).
Prior to joining Severalnines, Sebastian worked as a consultant to state companies in security, database replication and high availability scenarios. He’s also a speaker and has given a few talks locally on InnoDB Cluster and MySQL Enterprise together with an Oracle team. Previous to that, he worked for a Mexican company as chief of sysadmin department as well as for a local ISP (Internet Service Provider), where he managed customers' servers and connectivity.
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Severalnines
Failover is the process of moving to a healthy standby component, during a failure or maintenance event, in order to preserve uptime. The quicker it can be done, the faster you can be back online. However, failover can be tricky for transactional database systems as we strive to preserve data integrity - especially in asynchronous or semi-synchronous topologies. There are risks associated, from diverging datasets to loss of data. Failing over due to incorrect reasoning, e.g., failed heartbeats in the case of network partitioning, can also cause significant harm.
This webinar replay gives a detailed overview of what failover processes may look like in MySQL, MariaDB and PostgreSQL replication setups. We’ve covered the dangers related to the failover process, and discuss the tradeoffs between failover speed and data integrity. We’ve found out about how to shield applications from database failures with the help of proxies. And we've finally had a look at how ClusterControl manages the failover process, and how it can be configured for both assisted and automated failover.
So if you’re looking at minimizing downtime and meet your SLAs through an automated or semi-automated approach, then this webinar replay is for you!
AGENDA
- An introduction to failover - what, when, how
- in MySQL / MariaDB
- in PostgreSQL
- To automate or not to automate
- Understanding the failover process
- Orchestrating failover across the whole HA stack
- Difficult problems
- Network partitioning
- Missed heartbeats
- Split brain
- From assisted to fully automated failover with ClusterControl
- Demo
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
What if …
- Traditional, labour-intensive backup and archive practices for your MySQL, MariaDB, MongoDB and PostgreSQL databases were a thing of the past?
- You could have one backup management solution for all your business data?
- You could ensure integrity of all your backups?
- You could leverage the competitive pricing and almost limitless capacity of cloud-based backup while meeting cost, manageability, and compliance requirements from the business.
Welcome to our webinar on Backup Management with ClusterControl.
ClusterControl’s centralized backup management for open source databases provides you with hot backups of large datasets, point in time recovery in a couple of clicks, at-rest and in-transit data encryption, data integrity via automatic restore verification, cloud backups (AWS, Google and Azure) for Disaster Recovery, retention policies to ensure compliance, and automated alerts and reporting.
Whether you are looking at rebuilding your existing backup infrastructure, or updating it, this webinar is for you!
AGENDA
- Backup and recovery management of local or remote databases
- Logical or physical backups
- Full or Incremental backups
- Position or time-based Point in Time Recovery (for MySQL and PostgreSQL)
- Upload to the cloud (Amazon S3, Google Cloud Storage, Azure Storage)
- Encryption of backup data
- Compression of backup data
- One centralized backup system for your open source databases (Demo)
- Schedule, manage and operate backups
- Define backup policies, retention, history
- Validation - Automatic restore verification
- Backup reporting
SPEAKER
Bartlomiej Oles, Senior Support Engineer at Severalnines, is a MySQL and Oracle DBA, with over 15 years experience in managing highly available production systems at IBM, Nordea Bank, Acxiom, Lufthansa, and other Fortune 500 companies. In the past five years, his focus has been on building and applying automation tools to manage multi-datacenter database environments.
Disaster Recovery Planning for MySQL & MariaDBSeveralnines
Bart Oles - Severalnines AB
Organizations need an appropriate disaster recovery plan to mitigate the impact of downtime. But how much should a business invest? Designing a highly available system comes at a cost, and not all businesses and indeed not all applications need five 9's availability.
We will explain fundamental disaster recovery concepts and walk you through the relevant options from the MySQL & MariaDB ecosystem to meet different tiers of disaster recovery requirements, and demonstrate how to automate an appropriate disaster recovery plan.
Krzysztof Ksiazek - Severalnines AB
So, you are a developer or sysadmin and showed some abilities in dealing with databases issues. And now, you have been elected to the role of DBA. And as you start managing the databases, you wonder…
* How do I tune them to make best use of the hardware?
* How do I optimize the Operating System?
* How do I best configure MySQL or MariaDB for a specific database workload?
If you're asking yourself the following questions when it comes to optimally running your MySQL or MariaDB databases, then this talk is for you!
We will discuss some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL or MariaDB database. We will also cover some of the variables which are frequently modified even though they should not.
Performance tuning is not easy, especially if you're not an experienced DBA, but you can go a surprisingly long way with a few basic guidelines.
Performance Tuning Cheat Sheet for MongoDBSeveralnines
Bart Oles - Severalnines AB
Database performance affects organizational performance, and we tend to look for quick fixes when under stress. But how can we better understand our database workload and factors that may cause harm to it? What are the limitations in MongoDB that could potentially impact cluster performance?
In this talk, we will show you how to identify the factors that limit database performance. We will start with the free MongoDB Cloud monitoring tools. Then we will move on to log files and queries. To be able to achieve optimal use of hardware resources, we will take a look into kernel optimization and other crucial OS settings. Finally, we will look into how to examine performance of MongoDB replication.
Advanced MySql Data-at-Rest Encryption in Percona ServerSeveralnines
Iwo Panowicz - Percona & Bart Oles - Severalnines AB
The purpose of the talk is to present data-at-rest encryption implementation in Percona Server for MySQL.
Differences between Oracle's MySQL and MariaDB implementation.
- How it is implemented?
- What is encrypted:
- Tablespaces?
- General tablespace?
- Double write buffer/parallel double write buffer?
- Temporary tablespaces? (KEY BLOCKS)
- Binlogs?
- Slow/general/error logs?
- MyISAM? MyRocks? X?
- Performance overhead.
- Backups?
- Transportable tablespaces. Transfer key.
- Plugins
- Keyrings in general
- Key rotation?
- General-Purpose Keyring Key-Management Functions
- Keyring_file
- Is useful? How to make it profitable?
- Keyring Vault
- How does it work?
- How to make a transition from keyring_file
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifeSeveralnines
Art Van Scheppingen - vidaXL & Bart Oles - Severalnines AB
Over the past few years, VidaXL has become a European market leader in the online retail of slow moving consumer goods. When a company achieved over 50% year over year growth for the past 9 years, there is hardly enough time to overhaul existing systems. This means existing systems will be stretched to the maximum of their capabilities, and often additional performance will be gained by utilizing a large variety of datastores.
Polyglot persistence reigns in rapidly growing environments and the traditional one-size-fits-all strategy of monoglots is over.
VidaXL has a broad landscape of datastores, ranging from traditional SQL data stores, like MySQL or PostgreSQL alongside more recent load balancing technologies such as ProxySQL, to document stores like MongoDB and search engines such as SOLR and Elasticsearch.
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Severalnines
Traditional server monitoring tools are not built for modern distributed database architectures. Let’s face it, most production databases today run in some kind of high availability setup - from simpler master-slave replication to multi-master clusters fronted by redundant load balancers. Operations teams deal with dozens, often hundreds of services that make up the database environment.
This is why we built ClusterControl - to address modern, highly distributed database setups based on replication or clustering. We wanted something that could provide a systems view of all the components of a distributed cluster, including load balancers.
Watch this replay of a webinar on free database monitoring using ClusterControl Community Edition. We show you how to monitor all your MySQL, MariaDB, PostgreSQL and MongoDB systems from a single point of control - whether they are deployed as Galera Clusters, sharded clusters or replication setups across on-prem and cloud data centers. We also see how to use Advisors in order to improve performance.
AGENDA
- Requirements for monitoring distributed database systems
- Cloud-based vs On-prem monitoring solutions
- Agent-based vs Agentless monitoring
- Deepdive into ClusterControl Community Edition
- Architecture
- Metrics Collection
- Trending
- Dashboards
- Queries
- Performance Advisors
- Other features available to Community users
SPEAKER
Bartlomiej Oles is a MySQL and Oracle DBA, with over 15 years experience in managing highly available production systems at IBM, Nordea Bank, Acxiom, Lufthansa, and other Fortune 500 companies. In the past five years, his focus has been on building and applying automation tools to manage multi-datacenter database environments.
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLSeveralnines
To operate PostgreSQL efficiently, you need to have insight into database performance and make sure it is at optimal levels.
With that in mind, we dive into monitoring PostgreSQL for performance in this webinar replay.
PostgreSQL offers many metrics through various status overviews and commands, but which ones really matter to you? How do you trend and alert on them? What is the meaning behind the metrics? And what are some of the most common causes for performance problems in production?
We discuss this and more in ordinary, plain DBA language. We also have a look at some of the tools available for PostgreSQL monitoring and trending; and we’ll show you how to leverage ClusterControl’s PostgreSQL metrics, dashboards, custom alerting and other features to track and optimize the performance of your system.
AGENDA
- PostgreSQL architecture overview
- Performance problems in production
- Common causes
- Key PostgreSQL metrics and their meaning
- Tuning for performance
- Performance monitoring tools
- Impact of monitoring on performance
- How to use ClusterControl to identify performance issues
- Demo
SPEAKER
Sebastian Insausti, Support Engineer at Severalnines, has loved technology since his childhood, when he did his first computer course (Windows 3.11). And from that moment he was decided on what his profession would be. He has since built up experience with MySQL, PostgreSQL, HAProxy, WAF (ModSecurity), Linux (RedHat, CentOS, OL, Ubuntu server), Monitoring (Nagios), Networking and Virtualization (VMWare, Proxmox, Hyper-V, RHEV).
Prior to joining Severalnines, Sebastian worked as a consultant to state companies in security, database replication and high availability scenarios. He’s also a speaker and has given a few talks locally on InnoDB Cluster and MySQL Enterprise together with an Oracle team. Previous to that, he worked for a Mexican company as chief of sysadmin department as well as for a local ISP (Internet Service Provider), where he managed customers' servers and connectivity.
This webinar builds upon a related blog post by Sebastian: https://severalnines.com/blog/performance-cheat-sheet-postgresql.
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningSeveralnines
If you’re asking yourself the following questions when it comes to optimally running your MySQL or MariaDB databases:
- How do I tune them to make best use of the hardware?
- How do I optimize the Operating System?
- How do I best configure MySQL or MariaDB for a specific database workload?
Then this replay is for you!
We discuss some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL or MariaDB database. We also cover some of the variables which are frequently modified even though they should not.
Performance tuning is not easy, especially if you’re not an experienced DBA, but you can go a surprisingly long way with a few basic guidelines.
This webinar builds upon blog posts by Krzysztof from the ‘Become a MySQL DBA’ series.
AGENDA
- What to tune and why?
- Tuning process
- Operating system tuning
- Memory
- I/O performance
- MySQL configuration tuning
- Memory
- I/O performance
- Useful tools
- Do’s and do not’s of MySQL tuning
- Changes in MySQL 8.0
SPEAKER
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBSeveralnines
Galera Cluster is a mainstream option for high availability MySQL and MariaDB. And though it has established itself as a credible replacement for traditional MySQL master-slave architectures, it is not a drop-in replacement.
While Galera Cluster has some characteristics that make it unsuitable for certain use cases, most applications can still be adapted to run on it.
The benefits are clear: multi-master InnoDB setup with built-in failover and read scalability.
But how do you migrate? Does the schema or application change? What are the limitations? Can a migration be done online, without service interruption? What are the potential risks?
In this webinar, Severalnines Support Engineer Bart Oles walks you through what you need to know in order to migrate from standalone or a master-slave MySQL/MariaDB setup to Galera Cluster.
AGENDA
- Application use cases for Galera
- Schema design
- Events and Triggers
- Query design
- Migrating the schema
- Load balancer and VIP
- Loading initial data into the cluster
- Limitations:
- Cluster technology
- Application vendor support
- Performing Online Migration to Galera
- Operational management checklist
- Belts and suspenders: Plan B
- Demo
SPEAKER
Bartlomiej Oles is a MySQL and Oracle DBA, with over 15 years experience in managing highly available production systems at IBM, Nordea Bank, Acxiom, Lufthansa, and other Fortune 500 companies. In the past five years, his focus has been on building and applying automation tools to manage multi-datacenter database environments.
Webinar slides: How to Measure Database Availability?Severalnines
Database availability is notoriously hard to measure and report on, although it is an important KPI in any SLA between you and your customer. We often define availability in terms of 9’s (e.g. 99.9% or 99.999%), although there is often a lack of understanding of what these numbers might mean, or how we can measure them.
Is the database available if an instance is up and running, but it is unable to serve any requests? Or if response times are excessively long, so that users consider the service unusable? Is the impact of one longer outage the same as multiple shorter outages? How do partial outages affect database availability, where some users are unable to use the service while others are completely unaffected?
Not agreeing on precise definitions with your customer might lead to dissatisfaction. The database team might be reporting that they have met their availability goals, while the customer is dissatisfied with the service. In this webinar, we will discuss the different factors that affect database availability. We will then see how you can measure your database availability in a realistic way.
AGENDA
- Defining availability targets
- Critical business functions
- Customer needs
- Duration and frequency of downtime
- Planned vs unplanned downtime
- SLA
- Measuring the database availability
- Failover/Switchover time
- Recovery time
- Upgrade time
- Queries latency
- Restoration time from backup
- Service outage time
- Instrumentation and tools to measure database availability:
- Free & open-source tools
- CC's Operational Report
- Paid tools
SPEAKER
Bartlomiej Oles is a MySQL and Oracle DBA, with over 15 years experience in managing highly available production systems at IBM, Nordea Bank, Acxiom, Lufthansa, and other Fortune 500 companies. In the past five years, his focus has been on building and applying automation tools to manage multi-datacenter database environments.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
Talk presented at Kubernetes Community Day, New York, May 2024.
Technical summary of Multi-Cluster Kubernetes Networking architectures with focus on 4 key topics.
1) Key patterns for Multi-cluster architectures
2) Architectural comparison of several OSS/ CNCF projects to address these patterns
3) Evolution trends for the APIs of these projects
4) Some design recommendations & guidelines for adopting/ deploying these solutions.
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
# Internet Security: Safeguarding Your Digital World
In the contemporary digital age, the internet is a cornerstone of our daily lives. It connects us to vast amounts of information, provides platforms for communication, enables commerce, and offers endless entertainment. However, with these conveniences come significant security challenges. Internet security is essential to protect our digital identities, sensitive data, and overall online experience. This comprehensive guide explores the multifaceted world of internet security, providing insights into its importance, common threats, and effective strategies to safeguard your digital world.
## Understanding Internet Security
Internet security encompasses the measures and protocols used to protect information, devices, and networks from unauthorized access, attacks, and damage. It involves a wide range of practices designed to safeguard data confidentiality, integrity, and availability. Effective internet security is crucial for individuals, businesses, and governments alike, as cyber threats continue to evolve in complexity and scale.
### Key Components of Internet Security
1. **Confidentiality**: Ensuring that information is accessible only to those authorized to access it.
2. **Integrity**: Protecting information from being altered or tampered with by unauthorized parties.
3. **Availability**: Ensuring that authorized users have reliable access to information and resources when needed.
## Common Internet Security Threats
Cyber threats are numerous and constantly evolving. Understanding these threats is the first step in protecting against them. Some of the most common internet security threats include:
### Malware
Malware, or malicious software, is designed to harm, exploit, or otherwise compromise a device, network, or service. Common types of malware include:
- **Viruses**: Programs that attach themselves to legitimate software and replicate, spreading to other programs and files.
- **Worms**: Standalone malware that replicates itself to spread to other computers.
- **Trojan Horses**: Malicious software disguised as legitimate software.
- **Ransomware**: Malware that encrypts a user's files and demands a ransom for the decryption key.
- **Spyware**: Software that secretly monitors and collects user information.
### Phishing
Phishing is a social engineering attack that aims to steal sensitive information such as usernames, passwords, and credit card details. Attackers often masquerade as trusted entities in email or other communication channels, tricking victims into providing their information.
### Man-in-the-Middle (MitM) Attacks
MitM attacks occur when an attacker intercepts and potentially alters communication between two parties without their knowledge. This can lead to the unauthorized acquisition of sensitive information.
### Denial-of-Service (DoS) and Distributed Denial-of-Service (DDoS) Attacks
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
test test test test testtest test testtest test testtest test testtest test ...
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tuning
1. Copyright 2016 Severalnines AB
1
Your host & some logistics
I'm Jean-Jérôme from the Severalnines Team
and I'm your host for today's webinar!
Feel free to ask any questions in the Questions
section of this application or via the Chat box.
You can also contact me directly via the chat
box or via email: jj@severalnines.com during
or after the webinar.
7. Copyright 2016 Severalnines AB
MySQL Query Tuning - Hinting the optimizer and improving query
performance
October 25, 2016
Krzysztof Książek
Severalnines
krzysztof@severalnines.com
7
8. Copyright 2016 Severalnines AB
8
Agenda
! InnoDB index statistics
! MySQL cost model
! Hints
! Index hints
! Legacy optimizer hints syntax
! New (5.7) optimizer hint syntax
! Optimizing SQL
10. Copyright 2016 Severalnines AB
10
InnoDB index statistics
! Query execution plan is calculated based on InnoDB index statistics
! Up to 5.6, default behavior is that statistics are recalculated when
! ANALYZE TABLE has been explicitly executed
! SHOW TABLE STATUS, SHOW TABLES or SHOW INDEX were executed
! Either 1/16th or 2 billion rows were modified in a table
! To calculate statistics, InnoDB performs a lookup into 8 index pages
! This is 128KB of data to calculate stats for, i.e. 100GB index
! Use innodb_stats_transient_sample_pages to change that
! Query execution plan may change after statistics recalculation
11. Copyright 2016 Severalnines AB
11
InnoDB index statistics
! In MySQL 5.6 statistics became (by default) more persistent
! They are not recalculated for every SHOW TABLE STATUS and similar commands
! They are updated when an explicit ANALYZE TABLE is run on the table or more than 10% of
rows in the table were modified
! As a result, query execution plans became more stable
! They are also calculated from a larger sample - 20 index pages
! Manageable through innodb_stats_persistent_sample_pages variable
! You can disable persistent statistics using innodb_stats_persistent
13. Copyright 2016 Severalnines AB
13
MySQL cost model
! To determine most efficient query execution plan, MySQL has to assess costs of different plans
! The least expensive one is picked
! Each operation - reading data from memory or from disk, creating temporary table in memory
and on disk, comparing rows, evaluating row conditions, has its own cost assigned
! Historically, those numbers were hardcoded and couldn’t be changed
! This changed with MySQL 5.7 - new tables were added in mysql schema
! server_cost
! engine_cost
14. Copyright 2016 Severalnines AB
14
MySQL cost model
! disk_temptable_create_cost,
disk_temptable_row_cost - cost to create and
maintain on-disk temporary table - by default 40 and 1
! memory_temptable_create_cost,
memory_temptable_row_cost - cost to create and
maintain in-memory temporary table - by default 2
and 0.2
! key_compare_cost - cost to compare record keys
(more expensive - less likely filesort will be used) - by
default - 0.1
! row_evaluate_cost - cost to evaluate rows (more
expensive - more likely index will be used for scan) - by
default - 0.2
15. Copyright 2016 Severalnines AB
15
MySQL cost model
! engine_name - InnoDB/MyISAM - by default all are affected
! device_type - not used, but in the future you could have different costs for different types of I/O
devices
! io_block_read_cost - cost of reading an index or data page from disk - by default 1
! memory_block_read_cost - cost of reading index or data page from memory - by default 1
16. Copyright 2016 Severalnines AB
16
MySQL cost model
! Optimizer is undergoing refactoring and rewriting - new features will follow
! Even now, in MySQL 5.7, you can modify costs which used to be hardcoded and tweak them
according to your hardware
! Disk operations will be less expensive on PCIe SSD than on spindles
! You can tweak engine_cost and server_cost to reflect that
! You can always revert your changes through updating costs to ‘NULL’
! Make sure you run FLUSH OPTIMIZER_COSTS; to apply your changes
! Use SHOW STATUS LIKE ‘Last_query_cost'; to check the cost of last executed query
18. Copyright 2016 Severalnines AB
18
! USE INDEX - tells the optimizer that it should use one of the listed indexes
! FORCE INDEX - a full table scan is marked as extremely expensive operation and therefore won’t
be used by the optimizer - as long as any of the listed indexes could be used for our particular
query
! IGNORE INDEX - tells the optimizer which indexes we don’t want it to consider
Index hints
20. Copyright 2016 Severalnines AB
20
Index hints
! Hints can be located in different places
! JOIN actor AS a IGNORE INDEX FOR JOIN (idx_actor_last_name)
! FORCE INDEX FOR ORDER BY(idx_actor_first_name)
! Following options are available:
! FORCE INDEX FOR JOIN (idx_myindex)
! FORCE INDEX FOR ORDER BY (idx_myindex)
! FORCE INDEX FOR GROUP BY (idx_myindex)
! FORCE INDEX (idx_myindex) aggregates all of those above
21. Copyright 2016 Severalnines AB
21
Index hints
! When you are executing any query with JOINs, the MySQL optimizer has to decide the order in
which those tables should be joined
! A result is not always optimal
! STRAIGHT_JOIN can be used to force order in which tables will be joined
! Works for JOIN only - LEFT or RIGHT JOIN’s already enforce some order
! Let’s assume this query on Sakila database:
EXPLAIN SELECT actor_id, title FROM film_actor AS fa JOIN film AS f ON fa.film_id = f.film_id
ORDER BY fa.actor_idG
23. Copyright 2016 Severalnines AB
23
Index hints - join order modificators
! Let’s say we want to avoid temporary table
! Following query will do the trick - note that STRAIGHT_JOIN is used:
! EXPLAIN SELECT STRAIGHT_JOIN actor_id, title FROM film_actor AS fa JOIN film AS f ON
fa.film_id = f.film_id ORDER BY fa.actor_idG
! Tables will be joined in a film_actor -> film order
25. Copyright 2016 Severalnines AB
25
Index hints - join order modificators
! You can manipulate the join order also within the query
! SELECT STRAIGHT_JOIN * FROM tab1 JOIN tab2 ON tab1.a = tab2.a JOIN tab3 ON tab2.b =
tab3.b;
! Only option of the optimizer will be: tab1, tab2, tab3
! SELECT * FROM tab1 JOIN tab2 ON tab1.a = tab2.a STRAIGHT_JOIN tab3 ON tab2.b = tab3.b;
! Two different options are possible now
! tab1, tab2, tab3
! tab2, tab3, tab1
27. Copyright 2016 Severalnines AB
27
Controlling the optimizer - optimizer switch
! With time MySQL optimizer got improved and new algorithms were added
! MariaDB added their own set of optimizations and optimizer features
! Some of those features can be disabled by user on global and session level
! SET GLOBAL optimizer_switch=“index_merge=off";
! SET SESSION optimizer_switch=“index_merge=off";
! Sometimes this is the only way to make sure your query will be executed in an optimal way
29. Copyright 2016 Severalnines AB
29
Controlling the optimizer - optimizer hints (5.7)
! As of MySQL 5.7.7, new way of controlling
optimizer has been added
! Hints use /*+ … */ syntax within query
! Takes precedence over optimizer_switch
variable
! Work on multiple levels:
! Global
! Query block
! Table
! Index
30. Copyright 2016 Severalnines AB
30
Controlling the optimizer - optimizer hints (5.7)
Hint Name Description Applicable Scopes
BKA, NO_BKA Affects Batched Key Access join processing Query block, table
BNL, NO_BNL Affects Block Nested-Loop join processing Query block, table
MAX_EXECUTION_TIME Limits statement execution time Global
MRR, NO_MRR Affects Multi-Range Read optimization Table, index
NO_ICP Affects Index Condition Pushdown optimization Table, index
NO_RANGE_OPTIMIZATION Affects range optimization Table, index
QB_NAME Assigns name to query block Query block
SEMIJOIN, NO_SEMIJOIN Affects semi-join strategies Query block
SUBQUERY Affects materialization, IN-to-EXISTS subquery stratgies Query block
31. Copyright 2016 Severalnines AB
31
! Can be used at the beginning of a statement:
! SELECT /*+ ... */ ...
! INSERT /*+ ... */ ...
! REPLACE /*+ ... */ ...
! UPDATE /*+ ... */ ...
! DELETE /*+ ... */ ...
Controlling the optimizer - optimizer hints (5.7)
! Can be used in subqueries:
! (SELECT /*+ ... */ ... )
! (SELECT ... ) UNION (SELECT /*+ ... */ ... )
! (SELECT /*+ ... */ ... ) UNION (SELECT /*+ ...
*/ ... )
! UPDATE ... WHERE x IN (SELECT /*+ ... */ ...)
! INSERT ... SELECT /*+ ... */ ...
32. Copyright 2016 Severalnines AB
! Can be used on a table level:
! SELECT /*+ NO_BKA(t1, t2) */ t1.* FROM t1
INNER JOIN t2 INNER JOIN t3;
! SELECT /*+ NO_BNL() BKA(t1) */ t1.* FROM t1
INNER JOIN t2 INNER JOIN t3;
32
Controlling the optimizer - optimizer hints (5.7)
! Can be used on an index level:
! SELECT /*+ MRR(t1) */ * FROM t1 WHERE f2 <= 3
AND 3 <= f3;
! SELECT /*+ NO_RANGE_OPTIMIZATION(t3 PRIMARY,
f2_idx) */ f1 FROM t3 WHERE f1 > 30 AND f1 < 33;
! INSERT INTO t3(f1, f2, f3) (SELECT /*+ NO_ICP(t2) */
t2.f1, t2.f2, t2.f3 FROM t1,t2 WHERE t1.f1=t2.f1 AND
t2.f2 BETWEEN t1.f1 AND t1.f2 AND t2.f2 + 1 >= t1.f1
+ 1);
33. Copyright 2016 Severalnines AB
33
Controlling the optimizer - optimizer hints (5.7)
! SELECT /*+ MAX_EXECUTION_TIME(1000) */ * …
! Applies to the whole SELECT query
! Only applies to read-only SELECTs (does not apply to SELECTs which invoke stored routine)
! Does not apply to SELECTs in stored routines
! Very convenient way of adding safety - if you are not sure how long a query will take, limit its
maximum execution time
34. Copyright 2016 Severalnines AB
34
Pros and cons of using hints
! Enable you to fix optimizer mistakes
! Sometimes it’s the fastest way of solving a
performance issue
! Faster than, for example, adding an index
! Allow you to disable some parts of the
functionality of the optimizer
! Hardcoded hints can become a problem
! When you remove indexes: (ERROR 1176
(42000): Key 'idx_b' doesn't exist in table
‘tab')
! When you upgrade to next major MySQL
version (hint syntax may change)
! When data distribution changes and new
plan becomes optimal
36. Copyright 2016 Severalnines AB
36
Optimizing SQL
! MySQL is getting better in executing queries with every release
! What didn’t work in the past may work better in the latest version. Subqueries, for example
! MySQL 5.5: MySQL 5.6/5.7:
37. Copyright 2016 Severalnines AB
37
Optimizing SQL
! MySQL 5.5 usually requires rewrite of subquery into JOIN:
38. Copyright 2016 Severalnines AB
38
! When looking at JOIN queries, make sure
columns used to join tables are properly indexed
! Not indexed joins are the most common SQL
anti-pattern, and the most expensive one too
Optimizing SQL
40. Copyright 2016 Severalnines AB
40
Optimizing SQL
! Be aware of LIMIT - it may not actually limit number of rows scanned - use ranges instead
! LIMIT 9000,10 would access 9010 rows
41. Copyright 2016 Severalnines AB
41
Optimizing SQL
! When using UNION in your query, make sure you use UNION ALL, otherwise a DISTINCT clause is
added and it requires additional processing of the data - temporary table is created with index
on it
! UNION ALL also requires temporary table (removed in MySQL 5.7), but no index is created
43. Copyright 2016 Severalnines AB
43
Optimizing SQL
! For GROUP BY and ORDER BY - try to make sure index is used, otherwise a temporary table will
be created or filesort has to be performed
44. Copyright 2016 Severalnines AB
44
Optimizing SQL
! When used in JOIN, try to sort and aggregate only using columns from a single table - such case
can be indexed. If you GROUP BY or ORDER BY using columns from both, it can’t be indexed
! The only way MySQL can use multiple indexes (but from the same table) is through index
merge
! And it’s not the fastest way of retrieving the data (more details on another slide)
! There’s definitely no way to use indexes across multiple tables
46. Copyright 2016 Severalnines AB
46
Optimizing SQL
! Avoid ORDER BY RAND() - it will create a temporary table
! Always
! ORDER BY RAND() is evil
! In app - generate random numbers from MIN(pk), MAX(pk) range
! Use them in WHERE pk=… or pk IN ( … )
! PK lookup - fast and efficient
! Verify you got correct number of rows, if not - repeat the process
47. Copyright 2016 Severalnines AB
47
Optimizing SQL
! Parallelize queries and aggregate them within application - MySQL cannot use multiple cores
per query (although there are worklogs regarding that so it may change in the future)
! Use home-grown scripts
! Use https://shardquery.com
! Parallel processing may not always be feasible, but, if it could be used, it can speed up data
processing significantly.
48. Copyright 2016 Severalnines AB
48
Thank You!
! Blog posts covering query tuning process:
! http://severalnines.com/blog/become-mysql-dba-blog-series-optimizer-hints-faster-query-
execution
! Register for other upcoming webinars:
! http://severalnines.com/upcoming-webinars
! Install ClusterControl:
! http://severalnines.com/getting-started
! Contact: jj@severalnines.com