June 19, 2013

Post: MySQL Query Patterns, Optimized - Webinar questions followup

order of columns in the index.  Example: WHERE (last_name, first_name) = (‘Karwin’, ‘Bill’); Q: On the Dynamic Pivot, the straight join… in this case to force MySQL to scan the `title` table first, grouping by kind_id in index order.  This made the… out upcoming Percona Training classes in North America and Europe. Join Percona and the MySQL community at our events.  The next…

Post: Is Synchronous Replication right for your app?

…form of Eventual Consistency where the client is forced to correct the problem before it can commit….to all nodes, we can (simultaneously) establish global ordering for the transaction, so by the time the…to define the relationship between them.  When someone joins a group, you run a transaction that …

Post: ORDER BY ... LIMIT Performance Optimization

… leading table. If ORDER BY is going by field from the table which is not first in the join order index can’t be used. Sometimes it means breaking normalization and duplicating column(s) you’re going to use in ORDER… or better lookup or use FORCE INDEX to force it to use appropriate index. One more note about ORDER BY … LIMIT is – it…

Post: Be careful when joining on CONCAT

…(11) column. No matter what I did – forced it to use key, forced a different join order, it did not want to use tb1… -> STRAIGHT_JOIN tb1 -> WHERE -> ( -> tb1.vid LIKE ‘prefix-%’ AND -> tb1.vid = CONCAT(‘prefix-’, tb2.ID) AND -> tb2.gid = 1337 -> ) ORDER BY tb1…_JOIN tb1 -> WHERE -> ( -> tb1.vid LIKE ‘prefix-%’ AND -> tb1.vid = CONCAT(‘prefix-’, CAST(tb2.ID AS CHAR)) AND -> tb2.gid = 1337 -> ) ORDER

Post: A case for MariaDB's Hash Joins

… which is the table orders are far greater than the size of the join buffer. The size of the join buffer is 32M… join is slow in this case, because we have to refill the join buffer with rows from orders table many times, and hash join… we can force the join algorithm used by setting appropriate values of “join_cache_level”. For example in my test I forced the optimizer…

Post: Join Optimizations in MySQL 5.6 and MariaDB 5.5

… – l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem FORCE INDEX (i_l_orderkey) where c_mktsegment = ‘AUTOMOBILE’ and… correspond to MariaDB with Hash Join and Key-ordered Scan enabled, and MariaDB with Hash Join and Key-ordered Scan disabled, and the only…

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

… with one join order takes an hour with another, and the optimizer chose the poorer of the two join orders. Why is one join order so… doesn’t want to choose this join order, so we’ll force it with STRAIGHT_JOIN: explain select STRAIGHT_JOIN …. +——-+———–+———–+———————————+ | table | type | rows | Extra | +——-+———–+———–+———————————+ | fact…

Comment: FusionIO 320GB MLC benchmarks

… random I/O too. And while an SSD can improve join performance remember that all queries on MySQL are essentially single… in joins such that denormalization will still almost always buy more performance. Also don’t forget that the optimizer may be forced to pick non-optimal join orders because of outer joins or hints, so just about any database which uses any joins can…

Post: MySQL 5.6 vs MySQL 5.5 and the Star Schema Benchmark

… the table by primary key.  This forces the storage engine to touch the …pf from p1 join p2 using(seq) where p1.state = p2.state order by p1.duration desc; +—–+———————-+———–+———-+———–+———–+——-+——-+————–+————–+——-+——-+ …

Post: High-Performance Click Analysis with MySQL

… Data clustering. InnoDB’s primary keys define the physical order rows are stored in.  That lets you … workload.  The nested-loop joins are not all that fast on big joins; the query optimizer can …But beware of falling into the trap of brute-forcing a solution that really needs to be solved …