June 19, 2013

Post: How to Identify Bad Queries in MySQL

… to the timestamp when the query executed, not merely the duration the query executed for, which has been available in MySQL for years. This is… mk-query-digest do to this missing analytical step. I have done it many times with simple awk scripts and various statistical measures…

Post: The new cool MySQL patch has landed! Check your queries performance!

query_time is in microseconds and you can set it for example to 300000 which is 0.3s! # Query_time: 0.503016 Lock_timeMySQL will not write into slow log any queries executedquery execution that information is written into the log instead the above statistics. The full slow log entry for a query

Post: Updated msl (microslow) patch, installation walk-through!

query execution times into the slow log. Originally MySQL database offered a second time resolution and also a 2 second minimum for the query…, query_plan, innodb] msl patch currently can log three types of information: query timings, execution plan details and InnoDB engine per-query statistics. …

Post: Find unused indexes

…duplicate indexes. This time we’ll …mysql. After some runs we can start to analyze the information on INDEX_STATISTICS table. mysql> SELECT * FROM INDEX_STATISTICSquery log. The concept is easy to understand. pt-index-usage reads the slow query log and execute every query with EXPLAIN to ask MySQL

Post: Why you should ignore MySQL's key cache hit ratio

… is a very limited use for the statistics from which the ratio is derived (but…waste of time! The Oracle folks arrived at this conclusion a long time before the MySQL world…query‘s execution time. Alas, that correlation fools us into thinking it’s a cause, and we optimize-by-surrogate-measure a time

Post: Write contentions on the query cache

time (about 160ms). Of course, I wanted to know more about how MySQL executes this query. …| 0.000013 | | statistics           | 0.000075 | | preparing            | 0.000016 | | executing            | 0.000003 | | Sending data         | 0.162272 | | end                  | 0.000008 | | query end…

Post: How Percona does a MySQL Performance Audit

queries in odd statuses, like “statistics“, I know something weird is going on, and I look deeper. I also look at the queries… the top 10 most expensive queries, in total execution time. By the way, the slow query logs in the stock MySQL server are extremely limited… show the query and the information mysqlsla outputs about it (execution times, etc), the EXPLAIN plan, and the desired modifications to the query or…

Post: Profiling MySQL stored routines

statistics available for this query SELECT whatstheweatherlike(5); Not overly useful for query optimization, is it? Well, I can still aggregate the slow queryqueries are being executed. This is where Jeremy’s SHOW PROFILE patch – which is included in all Community tree based Percona MySQL

Post: MySQL EXPLAIN limits and errors.

query execution. The reason is – MySQL does not really have the special “plan generating” step, instead plan is generated as a part of query execution… you can use SHOW STATUS “Handler” statistics to see if number of operations … MyISAM. EXPLAIN may take long time In MySQL 5.0 with addition of greedy…