is.js – micro check library
Category: Programming
A big part of my work has to do with code. I’ve worked as system administrator – installing, patching, and configuring someone else’s code. I’ve worked as independent programmer, writing code on my own. I also programmed as part of the team. And on top of that, I worked as Team Leader and Project Manager, where I had to interact a lot with programmers. Programming world on its own is as huge as the universe. There is always something to learn. When I find something worthy or something that I understand enough to write about, I share it in this category.
mkcast – tool for creating GIF screencasts of a terminal
Comcast – simulating crappy network connections
Comcast – simulating crappy network connections
MySQL view processing algorithms
I had a last work session last night, troubleshooting one of the project’s database performance issues. Without giving more details (at least for now), I want to save the link to MySQL view processing algorithms for future me.
For
UNDEFINED, MySQL chooses which algorithm to use. It prefersMERGEoverTEMPTABLEif possible, becauseMERGEis usually more efficient and because a view cannot be updatable if a temporary table is used.A reason to choose
TEMPTABLEexplicitly is that locks can be released on underlying tables after the temporary table has been created and before it is used to finish processing the statement. This might result in quicker lock release than theMERGEalgorithm so that other clients that use the view are not blocked as long.
A particular heavy query, using views, kept going into “Copying to tmp table” state, locking up the server and slowing everything to a crawl. Upon closer examination, the view was created without specifying the algorithm (UNDEFINED). Changing the view to use TEMPTABLE made everything so much faster.
I knew there were reasons for me being against using views in MySQL, but I could never remember them. This is one. Views not supporting indexes is another.
Gitlet – git implemented in JavaScript
Gitlet – git implemented in JavaScript. Why, you ask?
Over the last six years, I’ve become better at using Git for version control. But my conceptions of the index, the working copy, the object graph and remotes have just grown fuzzier.
Sometimes, I can only understand something by implementing it. So, I wrote Gitlet, my own version of Git. I pored over tutorials. I read articles about internals. I tried to understand how API commands work by reading the docs, then gave up and ran hundreds of experiments on repositories and rummaged throught the
.gitdirectory to figure out the results.I discovered that, if approached from the inside out, Git is easy to understand. It is the product of simple ideas that, when combined, produce something very deep and beautiful.
Spoken like a true hacker. My hat is off to you, sir.
