background preloader

Profiling

Facebook Twitter

EXPLAIN_demystified.pdf. How to find MySQL queries worth optimizing ? September 11, 2012 by Peter Zaitsev7 Comments One question I often get is how one can find out queries which should be optimized.

How to find MySQL queries worth optimizing ?

By looking at pt-query-digest report it is easy to find slow queries or queries which cause the large portion of the load on the system but how do we know whenever there is any possibility to make this query run better ? The full answer to this question will indeed require complex analyses as there are many possible ways query can be optimized. There is however one extremely helpful metric which you can use – ratio between rows sent and rows analyzed.

Lets look at this example: The query in this case has sent zero rows (as there are no matches) but it had to examine 10Mil rows to produce result. Rows_examined=0 same as Rows_sent meaning this query is optimized quite well. It looks simple so far but it also a huge oversimplification. In this case we have 2 rows analyzed for each row set which is expected as we have 2 (logical) tables used in the query. View topic - Perl compile pb : Term. The innotop MySQL and InnoDB monitor at Xaprb. MySQL and InnoDB expose lots of information about their internals, but it’s hard to gather it all into one place and make sense of it.

The innotop MySQL and InnoDB monitor at Xaprb

I’ve written a tool to do that, and you are free to download and use it. This article introduces innotop, a powerful text-mode MySQL and InnoDB monitoring tool. It has lots of features, is fast and configurable, and it’s easy to use. Note: I’m now making it a priority to make innotop very stable and robust. If innotop crashes, please help me fix it. Why another text-mode monitoring tool? Because the available ones aren’t good enough. I said innotop has lots of features and is really flexible. How to find out who is locking a table in MySQL at Xaprb. Mon, Jul 31, 2006 in Databases.

How to find out who is locking a table in MySQL at Xaprb

Detecting and removing unused indexes in MySQL - moviepilot's tech blog. Posted on Dec 19 2012 There has been an avalanche of articles about the lessons marketers can learn from Barack Obama’s 2012 presidential campaign.

detecting and removing unused indexes in MySQL - moviepilot's tech blog

There has never been a political digital campaign of such scale and scope, and the technology and data mining techniques applied by Obama’s team should be of special interest to Hollywood’s marketers. There are striking similarities between campaigning for the next box office hit and for the election of the next president of the United States. by Tobi Bauckhage co-founder and CEO moviepilot.com Let’s begin by observing some similarities: First Weekend vs. There is no other industry where the rules of market economy condense with such brutality and drama into one single moment of truth as film. The whole film industry is watching the first numbers coming in on Friday evening from the east coast, first exit polls analysis are evaluated and predictions for the weekend’s box-office results and overall success of a movie are made on Saturday. Innodb Performance Optimization Basics.

November 1, 2007 by Peter Zaitsev77 Comments Note: There is an updated post on this topic here.

Innodb Performance Optimization Basics

Interviewing people for our Job Openings I like to ask them a basic question – if you have a server with 16GB of RAM which will be dedicated for MySQL with large Innodb database using typical Web workload what settings you would adjust and interestingly enough most people fail to come up with anything reasonable. So I decided to publish the answer I would like to hear extending it with basics of Hardware OS And Application optimization.

I call this Innodb Performance Optimization Basics so these are general guidelines which work well for wide range of applications, though the optimal settings of course depend on the workload. Hardware If you have large Innodb database size Memory is paramount. 16G-32G is the cost efficient value these days. Operating System First – run 64bit operating system. There are bunch of other options you may want to tune but lets focus only on Innodb ones today. MySQL Performance Blog. Understanding real-time performance statistics in MySQL. Monitor All SQL Queries in MySQL. Microsoft’s SQL Server has a tool called Profiler that you can use to monitor every SQL query that hits the database.

Monitor All SQL Queries in MySQL

This is extremely useful for programmers as well as database administrators to troubleshoot the exact queries generated by an application. Having switched to using MySQL on a frequent basis, this was one of the first things I wanted to figure out how to do. How else can you see the actual SQL code generated by WordPress or phpBB? The first thing we’ll need to do is turn on logging of queries in MySQL. Be warned that this should only be done in development… it really slows things down to log every single query to a file. Find and open your MySQL configuration file, usually /etc/mysql/my.cnf on Ubuntu. ## * Logging and Replication## Both location gets rotated by the cronjob.# Be aware that this log type is a performance killer.log = /var/log/mysql/mysql.log Just uncomment the “log” variable to turn on logging. Sudo /etc/init.d/mysql restart.

MySQL tuning