June 19, 2013

Post: Identifying the load with the help of pt-query-digest and Percona Server

of 20.08k queries were captured which are actually invocations of 167 different queries. Following that there are summaries ofUNIONof number of times this query was executed. Now let’s take a look at the values in the 95% columnMySQL. The end result might be that you end up limiting the number of

Post: Multi Column indexes vs Index Merge

…20 work similar way – MySQL just stops at different value. The enumerated ranges such…index on another column. This is because MySQL is able to estimate number of rows it…columns. In this case the combined index is useless and MySQL has an option of doing full table scan or doing the Union (instead of

Post: UNION vs UNION ALL Performance

Numbers would be different but it should not change general point of having optimization of moving LIMIT inside of unioncolumns with cardinality of 100, having about 40.000.000 of rows select * from test.abc where i=5 union

Post: Using UNION to implement loose index scan in MySQL

… 1 row in set (0.00 sec) Note number of rows has decreased from 90556 to …Lets see how query times differ in these cases: mysql> SELECT sql_no_…MySQL Optimizer and change the query so it can handle it well…. use UNION: mysql… or birth instead of age, and put zip as first column in the …

Post: Database access Optimization in Web Applications.

… links WHERE domain = ‘mysql.com’; will return only one row while may require to scan hundreds of thousands of rows (or index entries… in single UNION (with padding to accommodate different types and number of columns) – this is not a good practice. However if you can reduce number of queries…

Post: ORDER BY ... LIMIT Performance Optimization

…together with LIMIT is often the cause of MySQL Performance problems. Here is what you …UNION workaround I already wrote about. So what if you have application which can perform search on many different columns…need to rethink your indexing. Also note – number of records scanned to provide result set …