Tag - MySQL Optimizer

Why Optimization derived_merge can Break Your Queries

MySQL optimizer bugs

Lately, I worked on several queries which started returning wrong results after upgrading MySQL Server to version 5.7 The reason for the failure was derived merge optimization which is one of the default
optimizer_switch  options. Issues were solved, though at the price of performance, when we turned it
OFF . But, more importantly, we could […]

Read more

Introduction into storage engine troubleshooting: Q & A

Overlooked MySQL performance optimization

In this blog, I will provide answers to the Q & A for the “Introduction into storage engine troubleshooting” webinar.
First, I want to thank everybody for attending the July 14 webinar. The recording and slides for the webinar are available here. Below is the list of your questions that I wasn’t able to answer […]

Read more

MySQL optimizer: ANALYZE TABLE and Waiting for table flush

MySQL optimizer

The MySQL optimizer makes the decision of what execution plan to use based on the information provided by the storage engines. That information is not accurate in some engines like InnoDB and they are based in statistics calculations therefore sometimes some tune is needed. In InnoDB these statistics are calculated automatically, check the following […]

Read more

Indexes in MySQL

MySQL does not always make a right decision about indexes usage.
Condsider a simple table:

Shell

CREATE TABLE `t2` (
`ID` int(11) default NULL,
`ID1` int(11) default NULL,
`SUBNAME` varchar(32) default NULL,
KEY `ID1` (`ID1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

123456

CREATE TABLE `t2` (`ID` int(11) default NULL,`ID1` int(11) default NULL,`SUBNAME` varchar(32) default NULL,KEY `ID1` (`ID1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1

Shell

SELECT COUNT(*) FROM t2

1

SELECT COUNT(*) FROM t2

;
250001 […]

Read more