We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Rewrite Your Complex MySQL Queries for Better Performance

Formal Metadata

Title
Rewrite Your Complex MySQL Queries for Better Performance
Title of Series
Number of Parts
637
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Two MySQL queries that will return the same result, may sometimes have totally different queries plans. This happens because the query optimizer does not realize that the queries are equivalent. In this presentation, we will discuss how we can rewrite queries to help the optimizer find a better query plan. We will show several examples of how we can transform subqueries to make them more efficient, and we will also discuss how we can identify queries that can become faster if a subquery is replaced by window functions. Finally, we will discuss how MySQL 8.0 can do some of these transformations automatically.