My Most Useful MySQL Performance Tools

Here is a list of my most useful tools that I use when doing performance audits.Please note, I am writing this mainly for myself, because I sometimes end up trying to find them in my other blog post about mastering indexing and this may save me time as well as a few changes that have happened over the years.Regular Slow Log Reportpt-query-digest slow_query.log  >slow.txtAll Queries (that use indexes) for a certain tablept-query-digest slow_query.log  –filter ‘($event->{fingerprint} =~ m/^(!?select|update|delete)/) &&  ($event->{arg} =~ m/mytable /) ‘ –limit=100% >mytable.txtLongest Running Select Queries – most painful queries with response time % right next to them.pt-query-digest slow_query.log  –filter ‘($event->{fingerprint} =~ m/^(!?select)/)’  –order-by=Query_time:max > select.txtFilter the slow log for all Select queries for a certain tablept-query-digest slow_query.log  –filter ‘($event->{fingerprint} =~ m/^(!?select)/) &&  ($event->{arg} =~ m/mytable /) ‘ –no-report –output=slowlog >mytable.logFind unused indexes from pre-filtered table’s logs  pt-index-usage mytable.log –host 127.0.0.1 –tables mytable >mytable_indexes.txt Find Top 15 Largest tables on a server (use with caution) – (from http://ift.tt/Ifs2kC)—————————–delimiter $$create procedure dba.largest()beginSELECT CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS TABLE_NAME,CONCAT(ROUND(TABLE_ROWS / 1000000, 2), ‘M’) ROWS,CONCAT(ROUND(DATA_LENGTH / ( 1024 * 1024 * 1024 ), 2), ‘G’) DATA,CONCAT(ROUND(INDEX_LENGTH / ( 1024 * 1024 * 1024 ), 2), ‘G’) IDX,CONCAT(ROUND(( DATA_LENGTH + INDEX_LENGTH ) / ( 1024 * 1024 * 1024 ), 2), ‘G’) TOTAL_SIZE,ROUND(INDEX_LENGTH / DATA_LENGTH, 2) IDXFRACFROM INFORMATION_SCHEMA.TABLESORDER BY DATA_LENGTH + INDEX_LENGTH DESCLIMIT 15;end $$delimiter ;———————————ToDo:Run filtered log against database with the percona toolkit log player to test index improvements.
via Planet MySQL
My Most Useful MySQL Performance Tools

2014: The Year in Photos, September-December

A protester holds her hands up in front of a police car in Ferguson, Missouri, on November 25, 2014 during demonstrations a day after violent protests and looting following the grand jury decision in the fatal shooting of a 18-year-old black teenager Michael Brown. Protest marches sprang up in cities across the US on November 25, amid a tense security operation in Ferguson, the Missouri town at the center of the country’s latest racially-charged stand-off.





via In Focus
2014: The Year in Photos, September-December

New Hot Tub Time Machine Trailer? New Hot Tub Time Machine Trailer!

Having conquered the demons of their past in 1986; our plucky heroes from Hot Tub Time Machine are living the good life in a modern world of their own making. But sometimes leaving well enough alone just isn’t good enough so it’s back into the hot tub for Nick, Lou, and Jacob for another riotous romp through space-time. This time, however, they’re going back…to the future!

via Gizmodo
New Hot Tub Time Machine Trailer? New Hot Tub Time Machine Trailer!

Hear the terrifying sound of the A-10 tank killer’s gun in an attack run

Hear the terrifying sound of the A-10 tank killer's gun in an attack run

This video contains one of the most terrifying human-produced sounds you can hear in the planet: The screaming noise from hell of an A-10 Warthog’s GAU-8 Avenger gatling gun. Some of the very few who were on its reticle and survived say its banshee scream was the worst thing they have ever heard.

It is a demonic sound indeed.


SPLOID is a new blog about awesome stuff. Join us on Facebook

via Gizmodo
Hear the terrifying sound of the A-10 tank killer’s gun in an attack run

Replace a Lost Apple ID Recovery Key Before You’re Locked Out

Replace a Lost Apple ID Recovery Key Before You're Locked Out

Apple’s two-factor authentication is great, but like other services, it relies on a Recovery Key when you get locked out. Without that key, you can’t access your account if it’s hacked. The Next Web learned this the hard way.

The Next Web’s Owen Williams was locked out of his Apple ID and didn’t have his Recovery Key. If you’re using two-factor authentication, this is almost as bad as losing your phone. The Recovery Key is your safeguard to prove that you’re you—if someone attempts and fails to get into your Apple account, the only way back in is with the Recovery Key. Without your Recovery Key, you’re locked out of your Apple ID for good and all your purchases are gone. Apple makes this abundantly clear when you sign up for two-factor authentication, but if you somehow missed this memo, you can get a new Recovery Key pretty easily:

  1. Go to the Apple ID page and log in.
  2. Click "Password and Security"
  3. Click "Replace Lost Key" and click Next
  4. Make sure you actually print or save your key somewhere safe this time

You can only generate a new Recovery Key if you have access to your account, so do it now while you still can. Head over to The Next Web for William’s whole story.

The dark side of Apple’s two-factor authentication | The Next Web


via Lifehacker
Replace a Lost Apple ID Recovery Key Before You’re Locked Out

Reminder: Gift Cards Are Tax-Free, So Make Sure You Don’t Get Charged

Reminder: Gift Cards Are Tax-Free, So Make Sure You Don't Get Charged

Gift cards are a great way to get someone exactly what they want without giving them straight cash— and there are many ways to save on them. Here’s a tip to save some cash: Remember that gift cards are tax-free, so make sure you don’t get accidentally charged.

NerdWallet explains:

A final tip to getting the best deal: Gift cards aren’t subject to taxes in any state in the country, but it does occasionally happen that customers are charged tax nonetheless. If this happens to you (whether by accident or on purpose), let your cashier or online retailer know and demand the refund you’re entitled to.

For more ways to save on gift cards, check out the full post linked below.

How to Get Gift Cards for Less | NerdWallet

Image from 401(k) 2012.


via Lifehacker
Reminder: Gift Cards Are Tax-Free, So Make Sure You Don’t Get Charged

Access Your Mac’s Hidden Paint Program In Preview

Access Your Mac's Hidden Paint Program In Preview

Preview is awesome for a number of reasons, and writer Dave Winer points out that it also makes a great paint program.

While you can’t create new works of art using just Preview, it is a more powerful editor than it looks at a glance. Just open up any image in Preview, click the toolbox icon, and you’ll get a bunch of editing tools. You can easily make backgrounds transparent, annotate images, draw whatever you want as an image, and more. Preview doesn’t have the charm of MS Paint, but it does a bit more than you’d think.

A hidden Mac paint program | Scripting News


via Lifehacker
Access Your Mac’s Hidden Paint Program In Preview