• GilaMonster (11/4/2013)


    Jeff Moden (11/4/2013)


    Yes, yes... I know... all of your character based columns are NVARCHAR(MAX) because someone believes that "Premature optimization is the root of all evil." The problem is no one ever considers such things as what I've just mentioned and even fewer go back and optimize when they're supposed to.

    Premature optimisation IS the root of all evil. This is not premature optimisation. This is poor data type choice. Premature optimisation would be something like selecting char over varchar because someone heard it's faster and didn't do any evaluations to see if it is or if there's a performance problem in the first place.

    Premature optimisation is making weird data type or design choices because 'they're faster' without any testing or any consideration as to whether any imagined or real performance problems exist, resulting in a more complex or strange design that's harder to maintain or even slower than it could be.

    I'm well aware of that. You and I have had this conversation before and I absolutely agree. I should have said "and that someone is wrong because making good choices as to data type is NOT a pre-optimization."

    My biggest problem with Mr. Knuth's fine words isn't with the words. It's with how people have tainted the meaning of the words. I had an "expert" "developer" look me straight in the face when I asked him why he designed a table with all of the character-based columns (even a Zip Code column!) as NVARCHAR(4000) and tell me that "Pre-Optimisation is the root of all evil". If I were a lesser man, I'd have killed him on the spot to end that particular gene pool. 😉

    I have the same problem with such "expert" "developers" that think that Agile methods mean that you don't have to document your code. :sick:

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)