“The least expensive query is the query you never run.” Data access is expensive for your application. It often requires CPU, network and disk access, all of which can take a lot of time. Using less computing resources, particularly in the cloud, results in decreased overall operational costs, so caches provide real value by avoiding [...]
Flexviews – part 3 – improving query performance using materialized views
Combating “data drift” In my first post in this series, I described materialized views (MVs). An MV is essentially a cached result set at one point in time. The contents of the MV will become incorrect (out of sync) when the underlying data changes. This loss of synchronization is sometimes called drift. This is conceptually [...]
How InnoDB handles REDO logging
Xaprb (Baron) recently blogged about how InnoDB performs a checkpoint , I thought it might be useful to explain another important mechanism that affects both response time and throughput – The transaction log.
Tokyo Tyrant -The Extras Part III : Write Bottleneck
This is part 3 of my Tyrant extra’s, part 1 focused on durability, part 2 focused on the perceived performance wall. #3. Tokyo Cabinet Can have only a single writer thread, bottlenecking performance When writing an application using Tokyo Cabinet only one connection can be opened as a “writerâ€Â while the rest are readers. Tyrant [...]
Poor man’s query logging
Occasionally there is a need to see what queries reach MySQL. The database provides several ways to share that information with you. One is called general log activated with
1 | --log |
(or
1 | --general-log |
in MySQL 5.1+) start-up parameter. The log writes any query being executed by MySQL to a file with limited amount of additional information. [...]
Fighting MySQL Replication Lag
The problem of MySQL Replication unable to catch up is quite common in MySQL world and in fact I already wrote about it. There are many aspects of managing mysql replication lag such as using proper hardware and configuring it properly. In this post I will just look at couple of query design mistakes which [...]
Recovering Innodb table Corruption
Assume you’re running MySQL with Innodb tables and you’ve got crappy hardware, driver bug, kernel bug, unlucky power failure or some rare MySQL bug and some pages in Innodb tablespace got corrupted. In such cases Innodb will typically print something like this: InnoDB: Database page corruption on disk or a failed InnoDB: file read of [...]
Is disk Everything for MySQL Performance ?
I read very nice post by Matt today and it has many good insights though I can’t say I agree on all points. First there is a lot of people out where which put it as disk is everything. Remember Paul Tuckfield saying “You should ask how many disks they have instead of how many [...]
Stored Function to generate Sequences
Today a customer asked me to help them to convert their sequence generation process to the stored procedure and even though I have already seen it somewhere I did not find it with two minutes of googling so I wrote a simple one myself and posting it here for public benefit or my later use
Heikki Tuuri Innodb answers – Part I
Its almost a month since I promised Heikki Tuuri to answer Innodb Questions. Heikki is a busy man so I got answers to only some of the questions but as people still poking me about this I decided to publish the answers I have so far. Plus we may get some interesting follow up questions [...]

