Alan’s coworker, Bill, had a bumper sticker on the back of his desk chair: Do not meddle in the affairs of wizards, for they are subtle and quick to anger. Bill acted the part, if all wizards looked homeless and didn’t shower for days on end. But Bill didn’t tolerate any criticism of his skills as a DBA, whether from Alan or anyone else at the company.

“Why would you use a stored procedure for that?” he’d storm. “Do you know how long that would take to execute?”

“No, no, NO! You use VARCHAR, not TEXT! VARCHAR!”

“Who cares if the server needs to defrag every couple weeks? It’s not like I’m going anywhere!”

Sadly, Bill died suddenly of a heart attack. Unlike Gandalf, Bill did not return in white, and Alan was promoted to DBA.

Bill may have been no wizard, but the dozen or so database servers he oversaw had his fingerprints -- literal and figurative -- all over them. It took Alan a month to sort out how Bill had gone about his business. Believing the position might cause him to have a heart attack as well, Alan set about doing some housecleaning.

At the top of his list was a commonly-referenced table. So many queries ran against it that it was the single biggest bottleneck in the entire stack. A naive SELECT statement took five minutes, returning the following.

 

It took Alan the better part of the day to remove all references to the table before deleting it. Bill, despite his credentials, didn’t think to ask the front-end development team to convert cardinal words to numbers before inserting them into the database. The wizard hadn’t been all-knowing, after all.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!