What Counts For A DBA: Humbug!

If you have seen the movie ‘The Christmas Carol’, you will remember that the evil bank owner Ebenezer Scrooge is not a proponent of the holiday season, claiming Christmas to be “a poor excuse for picking a man’s pocket every twenty-fifth of December” and doesn’t even want his employee Bob Cratchet to miss work on Christmas Day; work that involves foreclosing on his customers who no doubt spent their money on the holiday merriment instead of the mortgage. If you are unfamiliar with the story, I won’t spoil how it happens, but in the end, not surprisingly, his heart softens to the ordeal, gives Bob the day off and a big raise. However, even Scrooge 2.0’s head would have exploded at how much time his employee would be spending on the festivities nowadays.  

During the holiday season (more or less all of December and a bit of the surrounding months), the productivity of the average worker falls off to dangerously anemic levels. Preparations for parties, travel, shopping, office decorating, gift exchanging, vacations, team volunteering outings for Toys for Tots/Rescue Mission etc. and other seasonal activities encroach heavily upon the employee’s attention.  Most companies are complicit with this, organizing several holiday parties (team, department, division, company, SQL User Group), and in some companies this means that employees come back to work the next day a bit tired, or worst case, don’t come to work the next due to what is claimed to be a mysterious fruitcake related illness (we know the truth though). With productivity so low, many employees save up their vacation and take most of the month of December off in order to escape the frustration of getting work done in December, thereby multiplying the effect.   

However, all of these lazy employees, like me, for instance, are not my focus today. Rather, I wish to send a love letter of sorts to the excellent DBAs and consultants who tirelessly support the work that developers like myself have created and forced them to support, regardless of whether Charlie Brown is on TV or not.  Many production DBAs will have to work the holidays, or for the case of the observant DBA, carry around electronic leashes to be available in case their monitoring software determines there is cause for concern (day or night.) For many there will be issues. As each year passes, we get more and more electronic devices being used around the word that require the Internet to operate twenty four hours a day, since Christmas Day in one part of the word is Christmas Eve in another, and just another work day for still more parts of the world.  

So during this holiday season, when you are leaned back in your favorite sitting place with your bowl of gingerbread cookies and a glass of eggnog (more nog than egg, naturally), with  your new Internet connected phone, tablet, MP3 player, laptop computer, DVR, Internet radio, WiFi Router, TV Remote Control, TV, and Toaster humming along simultaneously, remember to take a few minutes to think about the production support staff, (especially our beloved DBAs!)  and what they go through when they are the only person available to solve a problem for tens of thousands of customers that will either be the next repeat customer, or the next negative reviewers, all based on just how well they handle the issues that we developers left them. So whether or not the DBA likes it, on Christmas morning they may have to say “humbug!” to the figgy pudding (whatever the heck that is) or perhaps their child’s first holiday to diagnose an issue that may have just needed an index that should have been caught in development or testing (by me, no doubt).  

Happy Holidays to all, and to all a good database design!

As an added bonus, enjoy the following festive picture by Andrea Benedtti (anbenedetti on twitter), a SQL Server MVP from Italy by running the following SQL Server 2008+ code…
Christmas Tree Drawn Using SQL Server Spatial Types

/*
********************
Happy SQL Christmas!
********************
Andrea Benedetti, SQL Server MVP
Twitter: @anbenedetti
*/

SET NOCOUNT ON;
/* please choose the level of the tree… 🙂 */
DECLARE @level smallint = 10;

DECLARE @i tinyint = 1;
DECLARE @Offset smallint = 10;
DECLARE @x1 smallint = 100;
DECLARE @y1 smallint = 100;
DECLARE @x2 smallint = 150;
DECLARE @y2 smallint = 100;
DECLARE @x3 smallint = 125;
DECLARE @y3 smallint = 115;
DECLARE @x4 smallint = 100;
DECLARE @y4 smallint = 100;
DECLARE @Tree TABLE( Id tinyint IDENTITY(1 , 1) ,
Triangle geometry );
DECLARE @Palline TABLE( Id tinyint IDENTITY(1 , 1) ,
Ball geometry );
WHILE @i <= @level
BEGIN
INSERT INTO @Tree( Triangle )
VALUES( geometry::STGeomFromText( ‘POLYGON ((‘ + CAST(@x1 AS varchar( 5 )) + ‘ ‘ + CAST(@y1 AS varchar( 5 )) + ‘,’ + CAST(@x2 AS varchar( 5 )) + ‘ ‘ + CAST(@y2 AS varchar( 5 )) + ‘,’ + CAST(@x3 AS varchar( 5 )) + ‘ ‘ + CAST(@y3 AS varchar( 5 )) + ‘,’ + CAST(@x4 AS varchar( 5 )) + ‘ ‘ + CAST(@y4 AS varchar( 5 )) + ‘))’ , 0 ));
INSERT INTO @Palline( Ball )
VALUES( geometry::STGeomFromText( ‘POINT(‘ + CAST(@x1 AS varchar( 5 )) + ‘ ‘ + CAST(@y1 AS varchar( 5 )) + ‘)’ , 0 ));
INSERT INTO @Palline( Ball )
VALUES( geometry::STGeomFromText( ‘POINT(‘ + CAST(@x2 AS varchar( 5 )) + ‘ ‘ + CAST(@y2 AS varchar( 5 )) + ‘)’ , 0 ));
INSERT INTO @Palline( Ball )
VALUES( geometry::STGeomFromText( ‘POINT(‘ + CAST(@x3 AS varchar( 5 )) + ‘ ‘ + CAST(@y3 AS varchar( 5 )) + ‘)’ , 0 ));

SET @x1-=@Offset;
SET @x2+=@Offset;
SET @x4-=@Offset;
SET @y1-=@Offset;
SET @y2-=@Offset;
SET @y3-=@Offset;
SET @y4-=@Offset;
SET @i+=1;
END;
SET @x1 = @x3 – @Offset;
SET @x2 = @x3 + @Offset;
SET @x3 = @x3 + @Offset;
SET @x4 = @x2;

INSERT INTO @Tree( Triangle )
VALUES( geometry::STGeomFromText( ‘POLYGON ((‘ + CAST(@x1 AS varchar( 5 )) + ‘ ‘ + CAST(@y1 AS varchar( 5 )) + ‘,’ + CAST(@x2 AS varchar( 5 )) + ‘ ‘ + CAST(@y2 AS varchar( 5 )) + ‘,’ + CAST(@x2 AS varchar( 5 )) + ‘ ‘ + CAST(@y3 AS varchar( 5 )) + ‘,’ + CAST(@x1 AS varchar( 5 )) + ‘ ‘ + CAST(@y3 AS varchar( 5 )) + ‘,’ + CAST(@x1 AS varchar( 5 )) + ‘ ‘ + CAST(@y1 AS varchar( 5 )) + ‘))’ , 0 ));

SELECT Triangle
FROM @Tree
UNION ALL
SELECT Ball.STBuffer( 3 )
FROM @Palline;