June 19, 2013

Post: MySQL Query Patterns, Optimized - Webinar questions followup

… compare the use of subqueries/multiple joins vs. multiple queries (e.g. temp tables)? For performance, it’s hard to make a… about which query patterns the optimizer recognizes, and which are left to the developer to refactor manually.  There could also be… solution for randomly choosing rows involves some compromise, either of performance, or of accuracy of randomness.  The ORDER BY RAND() solution…

Post: Virident vCache vs. FlashCache: Part 2

… which shows the most consistent performance. The others all have assorted performance drops scattered throughout the graph….these various tests. Clockwise from the top left in the next graph, we have “no cache”, …heap_table_size = 64M sort_buffer_size = 4M join_buffer_size = 4M thread_cache_size = …

Post: A case for MariaDB's Hash Joins

… test cases and then see how the joins perform for each test case. Test Case A – Join a small table that fits in… where clause that reduces the size of the joining data set. And hash join performs even badly and takes 7x more time for… you 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…

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

…(*) queries for such result sets MySQL will perform the join even if you use LEFT JOIN so it is not needed which slows down… very expensive. To get better performance you can “Help” MySQL and remove JOIN for count(*) and do JOIN after limiting result set for… 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 ?

… time. OK. Lets start with first simple MyISAM table and join query performed on INT fields: CREATE TABLE `intjoin` ( `i` int(10…+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: Is there a performance difference between JOIN and WHERE?

… to blog about the answer. “Is there a performance difference between putting the JOIN conditions in the ON clause or the WHERE… = 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…

Comment: Why MySQL could be slow with large tables ?

…does lot of counting. Does this look like a performance nightmare waiting to happen? Thanks, Will SELECT Q….JOIN tblanswersets ASets USING (answersetid) INNER JOIN tblanswersetsanswers_x ASAX USING (answersetid) INNER JOIN tblanswers A USING (answerid) LEFT JOIN (tblevalanswerresults e1 INNER JOIN

Post: MySQL 5.5 and MySQL 5.6 default variable values differences

… select var55.variable_name,left(var55.variable_value,40) value55, left(var56.variable_value,40) var56 from var55 left join var56 on var55…| 10 | 5 | | PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE | 10000 | 100 | | PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES | 1000000 | 1724 | | PERFORMANCE_SCHEMA_…

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

Post: MySQL VIEW as performance troublemaker

… keep queries simple without really thinking how it affects server performance. Even worse than that – looking at the short table which… users comments to the blog, naturally containing user_id which left comment, comment_id and comment text: CREATE TABLE `comments` ( `user… join” used to to join between them. In this particular case it is not that bad because “join cache” is used to perform it…