The Most Common Query Blunders...

  • And for interest sake, using NewID() which really is evaluated on every row, the average CPU and duration with the same test setup:

    CPU: 936

    Duration: 927.8

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You've probably got more material than you need by this point. This one's an old article, but I still find it useful to refer people to: https://www.simple-talk.com/sql/t-sql-programming/ten-common-sql-programming-mistakes/[/url].

    My guess is that, if you've been asked to present on "performance killers" that you'd be well advised to include some performance comparisons. Numbers, graphs, something. Nothing makes the point so well as "here's some code from production, here's my re-tuned version that took me 30 minutes to edit, and here's the 6-fold reduction in execution time/reads/whatever". If you have a trace showing that code being executed 12,582 times in a week, you'll have driven the nail in hard.

    Good luck!

    Rich

  • TheSQLGuru (12/25/2015)


    Jason A. Long (12/25/2015)


    TheSQLGuru (12/25/2015)


    How about I do a remote presentation of my Common TSQL Mistakes session? I have presented it somewhere around 100 times now for companies, User Groups, SQL Saturdays and other conferences. It is a AMAZING collection of magic bullets and bad-data causers, with lots of perf tuning hints thrown in along the way. Drop me a PM if you are interested. Depending on where you are I could even pop in for an onsite presentation of that and other sessions if your boss is interested. I love to travel and pick up Delta Qualification Miles! 🙂

    I'll talk to the boss man and see if he's willing to part with some of the training budget. If he's interested, I'l touch base and find out what you'd charge.

    If you want remote I will do that for free. I just LOVE giving that session!! I once gave it to the dev staff at a major bank and started with over 300 people on a webex. 2.5 hours in (on a 75 minute schedule) there were still over 200 people online firing questions at me. 🙂

    If you want to pay me or bring me up that would of course be awesome too! 😎

    Jason:

    I attended Kevin's all-day performance tuning class for SQL Saturday El Paso, and I'd highly recommend it. If you could get your bosses to swing some funds, bringing him down to present it to your developers would be triple plus good. But if all you can get is him doing a webex, that also would be good.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • Wayne West (1/5/2016)


    TheSQLGuru (12/25/2015)


    Jason A. Long (12/25/2015)


    TheSQLGuru (12/25/2015)


    How about I do a remote presentation of my Common TSQL Mistakes session? I have presented it somewhere around 100 times now for companies, User Groups, SQL Saturdays and other conferences. It is a AMAZING collection of magic bullets and bad-data causers, with lots of perf tuning hints thrown in along the way. Drop me a PM if you are interested. Depending on where you are I could even pop in for an onsite presentation of that and other sessions if your boss is interested. I love to travel and pick up Delta Qualification Miles! 🙂

    I'll talk to the boss man and see if he's willing to part with some of the training budget. If he's interested, I'l touch base and find out what you'd charge.

    If you want remote I will do that for free. I just LOVE giving that session!! I once gave it to the dev staff at a major bank and started with over 300 people on a webex. 2.5 hours in (on a 75 minute schedule) there were still over 200 people online firing questions at me. 🙂

    If you want to pay me or bring me up that would of course be awesome too! 😎

    Jason:

    I attended Kevin's all-day performance tuning class for SQL Saturday El Paso, and I'd highly recommend it. If you could get your bosses to swing some funds, bringing him down to present it to your developers would be triple plus good. But if all you can get is him doing a webex, that also would be good.

    WOW!! Thanks for the props, Wayne! And for the record, I did not pay him for that endorsement! 😀

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • Kevin, sorry for the delay in getting back in touch with you. I did talk to the boss yesterday. He's definitely game for doing the webex but he's giving me the no $$$ thing for now. I wanted to wait and see if I can get him to come off something to compensate you for your time, before I communicated back to you.

    If the free offer still stands, let me know what your schedule looks like and I'll get the ball rolling on our side. In the mean time, I'll continue trying to loosen up the purse strings...

  • No worries. Send me a PM and I will get you my email address and we can get something set up. We can start with Common TSQL Mistakes and hopefully that will make the team chomp at the bit for more and we can get a day to three set aside for perhaps all-day training and/or a full-blown performance review of your stuff (top-to-bottom review, and much more than just app code and database schema).

    I am at CodeMash all this week and will likely be catching up from that time-suck all next week. Third week of January maybe?

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • I just wanted to give a HUGE thank you to Kevin. He gave his "Common SQL Programming Mistakes" presentation for out company today.

    It's an outstanding presentation. If you you're fortunate enough to have the opportunity see his presentation, don't pass it up. I highly recommend it!

    Once again, Thank you Kevin! 🙂

  • Jason A. Long (1/28/2016)


    I just wanted to give a HUGE thank you to Kevin. He gave his "Common SQL Programming Mistakes" presentation for out company today.

    It's an outstanding presentation. If you you're fortunate enough to have the opportunity see his presentation, don't pass it up. I highly recommend it!

    Once again, Thank you Kevin! 🙂

    Thanks for the props Jason!! It was a pleasure. Your team asked some good questions! From the sounds of the discussions you have a lot of stuff to go fix, eh?? :w00t:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • Rich Mechaber (1/5/2016)


    You've probably got more material than you need by this point. This one's an old article, but I still find it useful to refer people to: https://www.simple-talk.com/sql/t-sql-programming/ten-common-sql-programming-mistakes/[/url].

    It still amazes me that so many people with top ten lists still use single part naming conventions instead of 2 part naming. Other than that nuance, it's a pretty good and timeless article.

    --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)

  • Jeff Moden (1/28/2016)


    Rich Mechaber (1/5/2016)


    You've probably got more material than you need by this point. This one's an old article, but I still find it useful to refer people to: https://www.simple-talk.com/sql/t-sql-programming/ten-common-sql-programming-mistakes/[/url].

    It still amazes me that so many people with top ten lists still use single part naming conventions instead of 2 part naming.

    Single-part naming for columns cost me most of this week. The replication problem I've been fighting with since Saturday turned out to be caused by a procedure with an ambiguous column error.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • TheSQLGuru (1/28/2016)


    Jason A. Long (1/28/2016)


    I just wanted to give a HUGE thank you to Kevin. He gave his "Common SQL Programming Mistakes" presentation for out company today.

    It's an outstanding presentation. If you you're fortunate enough to have the opportunity see his presentation, don't pass it up. I highly recommend it!

    Once again, Thank you Kevin! 🙂

    Thanks for the props Jason!! It was a pleasure. Your team asked some good questions! From the sounds of the discussions you have a lot of stuff to go fix, eh?? :w00t:

    Yea... You can say that. A good portion of the things you talked about are things I've been preaching for quite awhile now, so it was nice to have people hear it from a 3rd party authority. You also added some clarity it some issues that I wasn't aware of, which was really nice.

  • GilaMonster (1/29/2016)


    Jeff Moden (1/28/2016)


    Rich Mechaber (1/5/2016)


    You've probably got more material than you need by this point. This one's an old article, but I still find it useful to refer people to: https://www.simple-talk.com/sql/t-sql-programming/ten-common-sql-programming-mistakes/[/url].

    It still amazes me that so many people with top ten lists still use single part naming conventions instead of 2 part naming.

    Single-part naming for columns cost me most of this week. The replication problem I've been fighting with since Saturday turned out to be caused by a procedure with an ambiguous column error.

    Heh... I feel for ya. I've not had a single problem in that area that cost me that much time but, every time I try to help some company with a particular problem, it's a nightmare anytime I have to fix a query on a system (even if I may be familiar with the system) because they don't use 2 part naming on the columns (or in the FROM clause, either). Especially in this day and age of Intellisense and similar tools, there's just no excuse to not do it and it saves a huge amount of time when troubleshooting. You already knew all that but had to say it out loud for anyone else following this thread.

    --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)

  • Jeff Moden (1/29/2016)


    GilaMonster (1/29/2016)


    Jeff Moden (1/28/2016)


    Rich Mechaber (1/5/2016)


    You've probably got more material than you need by this point. This one's an old article, but I still find it useful to refer people to: https://www.simple-talk.com/sql/t-sql-programming/ten-common-sql-programming-mistakes/[/url].

    It still amazes me that so many people with top ten lists still use single part naming conventions instead of 2 part naming.

    Single-part naming for columns cost me most of this week. The replication problem I've been fighting with since Saturday turned out to be caused by a procedure with an ambiguous column error.

    Heh... I feel for ya. I've not had a single problem in that area that cost me that much time but, every time I try to help some company with a particular problem, it's a nightmare anytime I have to fix a query on a system (even if I may be familiar with the system) because they don't use 2 part naming on the columns (or in the FROM clause, either). Especially in this day and age of Intellisense and similar tools, there's just no excuse to not do it and it saves a huge amount of time when troubleshooting. You already knew all that but had to say it out loud for anyone else following this thread.

    I agree, it is amazing that one is constantly encountering this problem although I find it more common with developers which started developing on pre 2K5 versions of SQL Server.

    😎

  • Eirikur Eiriksson (1/29/2016)


    Jeff Moden (1/29/2016)


    GilaMonster (1/29/2016)


    Jeff Moden (1/28/2016)


    Rich Mechaber (1/5/2016)


    You've probably got more material than you need by this point. This one's an old article, but I still find it useful to refer people to: https://www.simple-talk.com/sql/t-sql-programming/ten-common-sql-programming-mistakes/[/url].

    It still amazes me that so many people with top ten lists still use single part naming conventions instead of 2 part naming.

    Single-part naming for columns cost me most of this week. The replication problem I've been fighting with since Saturday turned out to be caused by a procedure with an ambiguous column error.

    Heh... I feel for ya. I've not had a single problem in that area that cost me that much time but, every time I try to help some company with a particular problem, it's a nightmare anytime I have to fix a query on a system (even if I may be familiar with the system) because they don't use 2 part naming on the columns (or in the FROM clause, either). Especially in this day and age of Intellisense and similar tools, there's just no excuse to not do it and it saves a huge amount of time when troubleshooting. You already knew all that but had to say it out loud for anyone else following this thread.

    I agree, it is amazing that one is constantly encountering this problem although I find it more common with developers which started developing on pre 2K5 versions of SQL Server.

    😎

    The dev responsible only started a year ago. Every other stored proc in the system had all 2-part names. The one that broke had all but one column with 2-part names.

    The developer will not make that mistake again.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 14 posts - 61 through 73 (of 73 total)

You must be logged in to reply to this topic. Login to reply