This is the fourth in a series of articles on profiling MySQL. My past three articles have explained how to measure the work a query causes MySQL to do. In this article I introduce a tool I've written to do the work for you and produce a compact, readable report of that work, with all the math already done, and the measurements labelled and grouped for ease of comprehension. With this tool you can understand query performance at a glance.
If you're a programmer, you know the difference between a beginner and a master is the ability to write succinct code that does a great deal with very little work. If you can do this, you can easily raise your productivity and the quality of your work by an order of magnitude. Much more importantly, you can have a lot more fun writing code. Read on to learn how.
C.J. Blathers about recent major changes in his life.
https://colliertech.com/~cjcollier/confidential/sateOfTheCJ20060625.ogg
https://colliertech.com/~cjcollier/confidential/sateOfTheCJ20060625.mp3
Mail me for credentials.
It’s been a hectic week, and it’s only Tuesday.
My wife and I recently made a decision to move on from MySQL. My passion is software development, and my experience doesn’t lend itself well to database development. Therefore, I’m returning to Amazon on Monday, if my intel is correct.
Through a strange series of coincidences, my resume was submitted to the same group which I left 14 short months ago. I will be returning to HTML, JavaScript, Perl, shell script and a tad bit of Java development.
It has been a pleasure working for and with MySQL AB. They make a wonderful database, and their support folks are top notch. I’ll miss them all. But heck, I can stay in touch just as easily as ever. That’s one nice thing about working in a virtual company: you learn to keep in touch by any means necessary.
The roses are blooming. The lawn is mowed. Summer vacation starts Real Soon Now™, and I’ll be taking …
[Read more]Sudoku solver
There are probably tons of these already available, but here is a quick sudoku solver (in Perl):
#! /usr/bin/perl # Example: # # echo $' 2 \n 1 9 4 \n 2 1 5 9\n3 6 \n 68 41 5\n 427 8 \n 51 \n 7 3 \n79 5 '| perl sudoku-solve.pl # use strict; use warnings; my $s = read_sudoku(); my $res= solve($s); if($res) { print_sudoku($res); print "Got it!\n"; } else { print "Failed :-(\n"; } exit 0; sub solve { my ($s)= @_; my $res= try_solve($s); return $s if $res eq 'SOLVED'; return undef if $res eq 'FAIL'; # Make a guess, backtracking if we were wrong. # Try to find some field where there are only two possibilities. my ($a, $b); OUTER: for my $i (0..8) { INNER: for my $j (0..8) { next INNER if keys(%{$s->[$i][$j]}) == 1; if(keys(%{$s->[$i][$j]}) == 2) { ($a,$b)= ($i,$j); last OUTER; } elsif(!defined($a)) { ($a,$b)= ($i,$j); } …[Read more]
Patrick released a new version of the perl MySQL connector. This .pm was my introduction to the mysql world, way back in the day. If you can program your way out of a perl brown paper bag and you haven’t used this tool yet, I recommend you write a hello world program to get familiar with it. Good stuff.
Dear DBD::mysql users, This announcement comes a few days late, but DBD::mysql version 3.0004 (stable, production) and 3.0004_1 (dev) have been released! Version 3.0004 is the production version with server-side prepare statements turned off by default, and 3.0004_1 is the development version with server-side prepare statements turned on by default. The changes in 3.0004, as listed in the changelog: * Fix dbd_st_finish which closed the handle prematurely (Martin Evans) * Compile issues (Martin Evans) * Fix to dbd_bind_ph to deal with numbers (ints, floats) correctly (Alexey Stroganov) * Test changes - bind_param 41 and 42 The changes to …[Read more]
"Ovid":http://users.easystreet.com/ovid/ wrote a short article "giving a glimpse of Perl 6":http://www.oreillynet.com/onlamp/blog/2006/05/lamp_linuxsapachesmysqlphpytho.html?CMP=OTC-6YE827253101&ATT=lamp+Linux+s+Apache+s+MySQL+P+hp+ython+erl+56
If that was too dry and technical for you, then instead go read about how he "he caught two idiots using his credit card":http://www.askbjoernhansen.com/archives/2005/03/25/catching_the_cr.html last year.
"Ovid":http://users.easystreet.com/ovid/ wrote a short article "giving a glimpse of Perl 6":http://www.oreillynet.com/onlamp/blog/2006/05/lamp_linuxsapachesmysqlphpytho.html?CMP=OTC-6YE827253101&ATT=lamp+Linux+s+Apache+s+MySQL+P+hp+ython+erl+56
If that was too dry and technical for you, then instead go read about how he "he caught two idiots using his credit card":http://www.askbjoernhansen.com/archives/2005/03/25/catching_the_cr.html last year.
Hey all. Please comment on this entry. I’m trying to get an idea of who’s listening to what I say.
Why do you read this blog? Are you interested in community wireless networks? OpenGL development on Linux? Family? Business Intelligence? Synchronizaton Manager news? Freecycle™ development? Random Perl bits? Something else I’ve forgotten about?
I’m finding myself over-extended and I need to cut back on some of the things I focus on. Please let me know what is important to you so I know how best to re-organize my time, energy and other resources.
© cjcollier for C.J.'s WordPress of studlyness, 2006. | Permalink | No comment
Filed under ewn, …
[Read more]