May 26, 2012

Post: A rule of thumb for choosing column order in indexes

… wanted to share a little rule of thumb I sometimes use to decide which columns should come first in an index. This is not specific to MySQL, it’s generally applicable to any database server with b-tree indexes. And there are a bunch of subtleties, but I will also ignore those for the sake of simplicity. Let’s…

Post: The MySQL optimizer, the OS cache, and sequential versus random I/O

… cost for a query, then choose the query plan that has the lowest cost. The unit of cost for the… per second, as a rule of thumb. If you do the math with the rows column in EXPLAIN, you realize that…, and do index lookups in the two dimension tables. MySQL doesn’t want to choose this join order, so we…