Prepared Statement Samples

One of our most useful features is Top Queries, which allows users to examine various metrics for families of similar queries. Once a query family is selected, we can drill down into its query samples. Individual samples are shown on a scatterplot. Selecting individual samples will display its captured SQL, latency, errors, and more.
We collect query samples by decoding the MySQL protocol over TCP and extracting the query text. Not only that, we also capture errors, warnings, and more by inspecting traffic over the wire.
Until now, query samples excluded prepared statements. This is because prepared statements are not sent over the wire as strings of SQL text. Statement preparation and execution is quite different from regular query execution, but in the end we generate a good approximation of what the statement SQL would look like and display it on the samples page.
Regenerating the statement text happens in three steps. First, we grab the statement text from a COM_STMT_PREPARE command sent from a client to the MySQL server. The server then sends the client a COM_STMT_PREPARE response with a statement ID. When a statement is to be executed, the client sends a COM_STMT_EXECUTE command to the server with the statement ID and its associated parameters. The parameters sent by the client are sent in the binary protocol format. When our agent sees a COM_STMT_EXECUTE, it decodes the parameters and does a string replace in the original statement text to approximate the SQL query text.
Regenerating SQL from prepared statement executions is not perfect, but should be very good. We understand the argument types, escape strings and text when necessary, and represent parameters in hex when we have to. You’ll notice that the metric parameter is a quoted string, not a literal number. That’s because we actually send that parameter in ASCII format, as text. The protocol doesn’t lie!
Of course, we’re showing a sample of SQL that never executed as displayed, which is kind of disingenuous, isn’t it? But if you think about it for a moment, this is exactly what you get from sources like the slow query log, which also shows SQL that’s reconstructed from the prepared statement with parameters substituted in. The main difference is that the slow query log doesn’t tell you it’s showing you SQL that never actually executed, whereas here the Action column is execute which tells you it’s a prepared statement, not a simple query.
Astute readers will have noticed the EXPLAIN tab to the right of the SQL sample. That’s an upcoming feature. Stay tuned for more on that!
If you are interested in seeing how this can benefit your company, please click below for a demo or here for a free trial.
via Planet MySQL
Prepared Statement Samples

Building A 10/22 Tactical Trainer With 8541 Tactical

8541One of my favorite Youtube channels, 8541 Tactical has started a series of videos that is showing the process of building a 10/22 as a precision rifle trainer.  John McQuay is someone that I have always followed and respected as a precision shooter.  I have followed his channel since its inception and have learned a […]

Read More …

The post Building A 10/22 Tactical Trainer With 8541 Tactical appeared first on The Firearm Blog.


via The Firearm Blog
Building A 10/22 Tactical Trainer With 8541 Tactical

Hover Hound Compares Newegg Prices with Tiger Direct and Amazon

Hover Hound Compares Newegg Prices with Tiger Direct and Amazon

Computer hardware is expensive, so you always want to ensure you’re buying at the best price. The Hover Hound extension for Chrome and Firefox compares hardware prices at Newegg with Tiger Direct and Amazon with a hover of your mouse cursor.

Once you’ve installed the extension, just head to Newegg and start browsing. As you peruse all the goodies, you’ll notice a green "Hover Hound" button below the "Add to Cart" button. Just hover your mouse over that green button and you’ll see the prices for the same item at Amazon and Tiger Direct. If you click the button, it will send you to wherever the price is the lowest outside of Newegg. It displays whether there is shipping and handling, and tells you whether an item qualifies for Amazon Prime.

Hover Hound Compares Newegg Prices with Tiger Direct and Amazon

You can also hover over the green button and click the "View Price History" link to see when the prices were at their highest and lowest for each seller, and what the prices were. To download the Chrome extension or Firefox add-on, check the links below.

Hover Hound | Chrome Web Store

Hover Hound | Firefox Add-Ons via Ghacks


via Lifehacker
Hover Hound Compares Newegg Prices with Tiger Direct and Amazon

Turn Your Grill into a Pizza Oven with This $20 DIY Kettle Pizza Clone

In our recent discussion on ways to hack your grill, Lifehacker reader torchbearer2 recommended the Kettle Pizza—an interesting accessory that turns your grill into a pizza oven. At $150, however, it’s not cheap. You can make your own version for about $20.

YouTube user madbare explains how to transform cheap steel flashing—which you can get from a home improvement store—into a clone of the Kettle Pizza. Although you don’t see him making the contraption in action, the design is very straightforward. He used a plasma cutter for the hole in the middle, but you can use a jigsaw instead.

In the comments on his video, he says:

Worked great and saw temps at the stone of 600F and in in the dome close to 900F. All in all I say it worked great. I did end up adding a couple more bolts to hold the stone in place and added a few 1/8 sheet metal screws around the top.

Let this be the Summer of Grilled Pizza.

DIY How to Build a Kettle Pizza Clone for $20 | YouTube


via Lifehacker
Turn Your Grill into a Pizza Oven with This $20 DIY Kettle Pizza Clone

This Simple Contraption Lets You Make 100 Water Balloons Every Minute

This Simple Contraption Lets You Make 100 Water Balloons Every Minute

Like with nuclear war, a water balloon fight isn’t about pinpoint accuracy. What’s most important is raining down as much soakage on your opponent as quickly as possible. Which means that the Bunch O Balloons, which promises to let you make 100 throw-ready water balloons every minute, could be the most important addition to your summertime arsenal.

This Simple Contraption Lets You Make 100 Water Balloons Every Minute

The Bunch O Balloons looks like a green 37-armed octopus with tiny empty balloons hanging off of every tentacle. The whole thing attaches to the end of a garden house and when the water’s turned on the balloons all automatically fill at the same time. When full they’re all easily dislodged with a simple shake, while small black elastics automatically seal them shut.

Bunch O Balloons’ creator, Josh Malone, is attempting to raise $10,000 on Kickstarter to put his invention into production. With a pledge of just $15 you can get a single pack which includes three hose attachments and a total of 100 water balloons—just add water.

It’s certainly more expensive than buying a bag of normal balloons, until you factor in the hours spent manually filling and tying 100 of them. Suddenly, $15 sounds like a reasonable investment if it keeps your kids occupied for an entire summer afternoon. [Kickstarter – Bunch O Balloons]

via Gizmodo
This Simple Contraption Lets You Make 100 Water Balloons Every Minute