May 25, 2012

Post: Multi Range Read (MRR) in MySQL 5.6 and MariaDB 5.5

column, pk_column FROM tbl WHERE key_column=x ORDER BY key_column (Note that secondary keys in InnoDB contain primary key columns) Buffer each pk_column

Post: Join Optimizations in MySQL 5.6 and MariaDB 5.5

… lookups. This means MySQL can employ many other optimizations like for example if columns other then the secondary key columns are required to be… is MRR Key-ordered Scan. Let’s see what this optimization actually is. Key-ordered Scan for BKA With this optimization the idea of… made on MySQL 5.6 config: optimizer_switch=’index_condition_pushdown=off’ optimizer_switch=’mrr=on’ optimizer_switch=’mrr_cost_based=off’ optimizer_switch=’batched…

Comment: What does Using filesort mean in MySQL?

I looked at the “ORDER BY OPTIMIZATION” section in MySQL manual but could not find a reason why MySQL does not use index in… just see this note: With EXPLAIN SELECT … ORDER BY, you can check whether MySQL can use indexes to resolve the query. It cannot if you see Using filesort in the Extra column.

Post: ORDER BY ... LIMIT Performance Optimization

… cause of MySQL Performance problems. Here is what you need to know about ORDER BY … LIMIT optimization to avoid these problems ORDER BY with LIMIT is most common use of ORDER BY in interactive… simply indexes column. Note: In some cases even if it is possible to use index to do ORDER BY with JOIN MySQL still…

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

… join order takes an hour with another, and the optimizer chose the poorer of the two join orders. Why is one join order so… about. Let’s start with the MySQL query optimizer. The optimizer tries to choose the best join order based on its cost metric; it… are indexes on all the columns in all the ways you’d expect: all the dimension columns are indexed on every table…

Post: Multi Column indexes vs Index Merge

… ranges between values in sorted order. For example when you query AGE=18 with single column BTREE index MySQL will dive into the… if we pretend we only have single column indexes (by hinting optimizer to ignore combined index) mysql [localhost] {msandbox} (test) > explain select avg…

Post: Shard-Query adds parallelism to queries

… of all available resources in order to handle the workload. One … query is single threaded in MySQL, the new optimizations don’t really help with…column. I partitioned the table into months using the FlightDate column using the improved MySQL 5.5 partitioning options which work directly on columns

Post: High-Performance Click Analysis with MySQL

MySQL, you will need to aggregate your data. What you want to do is aggregate in ways that optimize… clustering. InnoDB’s primary keys define the physical order rows are stored in.  That lets you…. You can have the clicks column record the total, and the blue_clicks column record only blue clicks;…

Post: MySQL Performance - eliminating ORDER BY function

… rules you would learn about MySQL Performance Optimization is to avoid using functions when comparing constants or order by. Ie use indexed_col… is able to avoid order by while second which uses direct column value needs to do the filesort: mysql> explain select * from tst where i=5 and date(d)=date(now()) order by…

Post: 3 ways MySQL uses indexes

… lookup. Very common problem I see is multi column indexes which are used but only to their … they are very hard on the optimizer. This just describes how MySQL uses single index – there are more…ORDER BY A ; ORDER BY A,B ; ORDER BY A DESC, B DESC will be able to use full index for sorting (note MySQL