June 20, 2013

Post: MySQL Query Patterns, Optimized - Webinar questions followup

… about which query patterns the optimizer recognizes, and which are left to the developer to refactor manually.  There could also be…_name) = (‘Karwin’, ‘Bill’); Q: On the Dynamic Pivot, the straight join, can you explain more about why you thought about doing… out upcoming Percona Training classes in North America and Europe. Join Percona and the MySQL community at our events.  The next…

Comment: Derived Tables and Views Performance

….id, a.label, a.link, Deriv1.Count FROM `menu` a LEFT OUTER JOIN (SELECT parent, COUNT(*) AS Count FROM `menu` GROUP BY…

Post: Virident vCache vs. FlashCache: Part 2

… system during all these various tests. Clockwise from the top left in the next graph, we have “no cache”, “FlashCache”, “vCache… = 16M max_heap_table_size = 64M sort_buffer_size = 4M join_buffer_size = 4M thread_cache_size = 1000 query_cache_size…

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 ?

…+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… Tables may suffer significantly if key compression is not disabled Joining on Shorter CHAR keys is significantly faster than Long keys…

Post: Is there a performance difference between JOIN and WHERE?

… the answer. “Is there a performance difference between putting the JOIN conditions in the ON clause or the WHERE clause in… = B.ID; SELECT * FROM A JOIN B ON A.ID = B.ID; SELECT * FROM A JOIN B USING(ID); Personally, I prefer… from “comma joins” because a) the ANSI join syntax is more expressive and you’re going to use it anyway for LEFT JOIN, and…

Post: A case for MariaDB's Hash Joins

… the number of rows needed to be joined from supplier table (left operand). Test Case D – Join a large data set (>1M rows… are joining tables with no indexes on the join condition (Full Join). The best performance with Hash Join can be achieved when the left table can fit completely in the join buffer…

Comment: Multi Column indexes vs Index Merge

left join idling_events i on g.id = i.gps_position_id left join moving_events m on g.id = m.gps_position_id left join overspeed_events o on g.id = o.gps_position_id left join locations l on l.id = gl.location_id left join ios…

Comment: Why MySQL could be slow with large tables ?

…) INNER JOIN tblanswersets ASets USING (answersetid) INNER JOIN tblanswersetsanswers_x ASAX USING (answersetid) INNER JOIN tblanswers A USING (answerid) LEFT JOIN (tblevalanswerresults e1 INNER JOIN tblevaluations…) INNER JOIN tblanswersets ASets USING (answersetid) INNER JOIN tblanswersetsanswers_x ASAX USING (answersetid) INNER JOIN tblanswers A USING (answerid) LEFT JOIN (tblevalanswerresults e1 INNER JOIN tblevaluations…

Comment: ORDER BY ... LIMIT Performance Optimization

… last 2 left joins affect considerably to the performance. Any idea how I can optimize this query? Thanks. SELECT * FROM message LEFT JOIN accounts a ON message_account = a.id LEFT JOIN opportunities o ON message_project = o.id LEFT JOIN leads l1 ON…(message_from) LIKE CONCAT(\’%\’, UCASE(l1.email2), \’%\’) AND l1.email2 \’\') LEFT JOIN leads l2 ON (UCASE(message_to) LIKE CONCAT(\’%\’, UCASE(l2…