June 20, 2013

Post: Using delayed JOIN to optimize count(*) and LIMIT queries

… for such result sets MySQL will perform the join even if you use LEFT JOIN so it is not needed which slows down… better performance you can “Help” MySQL and remove JOIN for count(*) and do JOIN after limiting result set for retrieval queries. Lets… select count(*) from fact left join dim on val=id where i select i,pad from fact left join dim on val=id where…

Post: Using CHAR keys for joins, how much is the overhead ?

…. I told them this is suboptimal but was challenged with rightful question about the difference. I did not know so I…+t2.j+length(t2.c)+t1.j) from intjoin t1 left join intjoin t2 on t1.i=t2.j; +———————————-+ | sum(t1.i…+t2.j+length(t2.c)+t1.j) from intjoin t1 left join intjoin t2 on t1.i=t2.j \G *************************** 1. row…

Post: A case for MariaDB's Hash Joins

… the join attributes and rows of the left operand. Next comes the probe phase, which is where the matching rows from the right… set of rows in the supplier table (left operand) to join to the lineitem table (right operand) so scanning the lineitem table (BNLH… the join buffer is 32M, while the size of the left operand is 186M which means roughly 6 scans of the right operand…

Post: Be productive with the MySQL command line

… given period of time. Instead of manually looking for the right line in the output of SHOW ENGINE INNODB STATUS (which… following query: mysql> select count(*) from film left join film_category using(film_id) left join category using(category_id) where name=’Music’; and let’s say you want to change the left joins to inner joins and…

Post: Moving Subtrees in Closure Table Hierarchies

… moving a subtree to a new position in my tree. Right now, I’m reading the nodes of the subtree into…, copying A-C, B-C, C-C and changing the right C to D gives A-D, B-D, C-D…. DELETE a FROM TreePaths AS a JOIN TreePaths AS d ON a.descendant = d.descendant LEFT JOIN TreePaths AS x ON x.ancestor…

Post: Optimize Your SQL With Percona's Online Query Advisor!

… that. Find the bug in this query: select * from t1 left join t2 using(id) where t2.created_date < 2012-02-15... results with you. Click here to see if you were right. That demonstrates another feature of the tool: you can share…

Post: Percona XtraDB Cluster: Failure Scenarios with only 2 nodes

… Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and…-11e1-0800-2491595e99bb,2) memb { 86928728-d56d-11e1-0800-f7c4916d8330, } joined { } left { } partitioned { 7e6d285b-d56d-11e1-0800-2491595e99bb, }) 120724 10:58:09…

Post: Percona turns two today !

… about this. So what is our strategy ? I left MySQL with idea of building company which will …keeping this inhouse, but it just does not feel right to leave people in need without a tool … challenges our customers have and we have consultants joining us with different backgrounds which allows us to …

Post: To pack or not to pack - MyISAM Key compression

… the key value and repeating it then repeating it for left or right half. For compressed block this is not going to… get previous value Random single row lookup by index (ie joins) will also suffer as key block needs to be uncompressed… savings. Defaults for MyISAM are good for most cases Avoid joining on strings, it is much slower anyway Watch for reverse…

Comment: Why MySQL could be slow with large tables ?

… PC) (select a, join b, where c…) eg: select a.a, b.x, etc.. from (select … .. ) a left outer join (select … ) b on b.a = a.a etc.. (in total I have like close to 11 subqueries joining a… statement, perhaps PostGres could better handle things? As it is, right now, I’m exploring the option of dumping the data…