How to annoy a DBA, or how to lose friends and alienate people…

How to annoy a DBA, or how to lose friends and alienate people…

I\’ve been mulling this one over for a while, but, seriously, I can\’t take much more of this. Those who are of a nervous disposition should look away now.


There\’s a lot of talk about why Developers and DBAs don\’t get on. It would be nice if we could all put our differences to one side and concentrate on what\’s common and what\’s best for the greater good. Altogether now… \”The Greater Good\” (with apologies to that excellent film, Hot Fuzz).


Personally, I think that until such time as we\’re all as proficient as each other in all required disciplines, that\’s NEVER going to happen. What we could do quite easily, however, is have a little more respect for each other\’s disciplines. I\’ll do the database performance and tuning stuff, you do your stuff, and we\’ll try not to start a punch-up, OK ? Would that suit ?


OK, all well and good.


Until I see this come over the wall :


CREATE PROCEDURE [dbo].[GetSomeDatesForACustomer]
        @FromDate       DATETIME
        ,@ToDate        DATETIME
AS
BEGIN
        SELECT 
                CustomerValue
                ,CONVERT(DATETIME,CONVERT(INT,AColumnOfDataTypeDATETIME))  as returnDate
        FROM   
                [dbo].[ArbitraryTable]
        WHERE  
                CONVERT(DATETIME,CONVERT(INT,AColumnOfDataTypeDATETIME)) >= @FromDate
                AND CONVERT(DATETIME,CONVERT(INT,AColumnOfDataTypeDATETIME)) <= @ToDate
END


When Developers stop writing code like the above, I\’ll stop being a grumpy DBA and might even talk to them at social functions, but it\’s gonna take a LONG time for me to see them as friends…..


I know that some developers treat talking to a DBA the same as a trip to the dentist – You know you should do it, and it\’s probably going to be either unpleasant or expensive, so you try to keep visits as infrequent as possible – but, come on guys. Have a heart ! Have some concern for your fellow geek ?


What works on your nice dev server that\’s got 42 cores, 64GB RAM, dedicated SSD storage, etc, WILL NOT have the same performance characteristics when placed on a shared SQLServer instance, where every KB of memory is accounted for, where every spindle is potentially shared with 100 other databases, where every precious CPU cycle is harnessed and protected for the greater good. (Altogether now… \”The Greater Good\”)


So please, think about what you\’re doing, and perhaps the rift between Developers and DBAs will have a chance of closing. Or have I just lost some friends and alienated some others ?


Back soon…