pt-online-schema-change is simple to use, but internally it is complex. Baron’s webinar about pt-online-schema-change hinted at several of the tool’s complexities. Consequently, users often want to know before making changes what pt-online-schema-change will do when it runs. The tool has two options to help answer this question: –dry-run and –print. When ran with –dry-run and –print, pt-online-schema-change changes nothing [...]
Edge-case behavior of INSERT…ODKU
A few weeks back, I was working on a customer issue wherein they were observing database performance that dropped through the floor (to the point of an outage) roughly every 4 weeks or so. Nothing special about the environment, the hardware, or the queries; really, the majority of the database was a single table with [...]
Recovering from a bad UPDATE statement
Did you just run an UPDATE against your 10 million row users table without a WHERE clause? Did you know that in MySQL 5.5 that sometimes you can recover from a bad UPDATE statement? This is possible if you are running in binlog_format=ROW ! Imagine this scenario:
1 2 3 4 5 6 | CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, `c2` varchar(10) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB; INSERT INTO `t1` (`c2`) VALUES ('michael'), ('peter'), ('aamina'); |
We run an accidental UPDATE statement that [...]
Timezone and pt-table-checksum
I recently worked through an issue with a client trying to detect data drift across some servers that were located in different timezones. Unfortunately, several of the tables had timestamp fields and were set to a default value of CURRENT_TIMESTAMP. From the manual, here is how MySQL handles timezone locality with timestamp fields: Values for TIMESTAMP columns are [...]
How to obtain the “LES” (Last Executed Statement) from an Optimized Core Dump?
Ever ran into a situation where you saw “some important variable you really needed to know about=<optimized out>” while debugging?
Announcing Percona Server 5.1.65-14.0
Percona is glad to announce the release of Percona Server 5.1.65-14.0 on September 4th, 2012 (Downloads are available here and from the Percona Software Repositories). Based on MySQL 5.1.65, including all the bug fixes in it, Percona Server 5.1.65-14.0 is now the current stable release in the 5.1 series. All of Percona‘s software is open-source and free, all the details of the release can [...]
When is MIN(DATE) != MIN(DATE) ?
Inspiration for this post is courtesy of a friend and former colleague of mine, Greg Youngblood, who pinged me last week with an interesting MySQL puzzle. He was running Percona Server 5.5.21 with a table structure that looks something like this:
1 2 3 4 5 6 7 8 9 | CREATE TABLE foo ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, uid INT UNSIGNED NOT NULL, update_time DATETIME NOT NULL, .... INDEX `uid` (uid, update_time), INDEX `bar` (some_other_columns) .... ) ENGINE=InnoDB; |
When he ran this query:
1 | SELECT MIN(update_time) FROM foo WHERE update_time IS NOT NULL AND update_time <> '0000-00-00 00:00:00'; |
The result came back as 2012-06-22 10:28:16. [...]
Differences between READ-COMMITTED and REPEATABLE-READ transaction isolation levels
As an instructor with Percona I’m sometimes asked about the differences between the READ COMMITTED and REPEATABLE READ transaction isolation levels. There are a few differences between READ-COMMITTED and REPEATABLE-READ, and they are all related to locking.
Full Text Search Webinar Questions Followup
I presented a webinar this week to give an overview of several Full Text Search solutions and compare their performance. Even if you missed the webinar, you can register for it, and you’ll be emailed a link to the recording. During my webinar, a number of attendees asked some good questions. Here are their questions and my [...]
Announcing Percona Server 5.5.27-28.0
Percona is glad to announce the release of Percona Server 5.5.27-28.0 on August 23rd, 2012 (Downloads are available here and from the Percona Software Repositories). Based on MySQL 5.5.27, including all the bug fixes in it, Percona Server 5.5.27-28.0 is now the current stable release in the 5.5 series. All of Percona‘s software is open-source and free, all the details of the release can [...]

