Are the posted questions getting worse?

  • Surprisingly enough, a Cursor would probably be faster than the Triangular Join method of doing the running totals that Carl currently has deployed. Right now, the running total calc he does generates more than 4 million internal rows on one leg of the execution plan.

    On my poor ol' 7 year old single CPU box, Carl's code has a best time of 44 seconds. I've got it down to just 15 seconds without doing any optimizations on his code... just replaced the running total logic on the 80k table. If you do the simple math, I've already got his 13 seconds down to just over 4 on his box and, like I said, I've made no optimizations to his logic.

    I've gotta get ready and scoot to work... that'll give the pork chops and the jar of apple sauce Paul gave me time to freeze up good and solid. 😛

    --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)
    Intro to Tally Tables and Functions

  • ps (6/20/2009)


    Paul White (6/20/2009)


    ps (6/20/2009)


    Well it looks as if someone's put his exam question papers here to be solved ..:-D

    http://qa.sqlservercentral.com/Forums/Topic738841-146-1.aspx

    It took an enormous effort of will on my part not to post sarcastic and/or deliberately wrong answers.

    Sigh.

    ummm.. i think we need to give him fair amount of chance to prove that he's willing to learn. He can obviously fast track his learnings here.[/quote]

    Learning is one thing. Giving answers that inhibit research on the OP's part is another. There are many avenues to learn and many others to allow shortcuts. Long range growth is to first attempt to do for yourself and then to seek help. Google and BOL can be your best friends and sites like this are simply great supplements in the process - IMO.

    -- You can't be late until you show up.

  • Anyone want to take a stab at 800+ lines of cursor-ridden, mostly uncommented code?

    http://qa.sqlservercentral.com/Forums/FindPost739170.aspx

    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
  • Oh, lordy. That's too much like work. After about the third SELECT DISTINCT, I lost interest. Sorry.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • GilaMonster (6/22/2009)


    Anyone want to take a stab at 800+ lines of cursor-ridden, mostly uncommented code?

    http://qa.sqlservercentral.com/Forums/FindPost739170.aspx

    I'll take the fact of less points on my side than him as an excuse to step back. Waaayyyyy back....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Grant Fritchey (6/22/2009)


    Oh, lordy. That's too much like work. After about the third SELECT DISTINCT, I lost interest.

    There are three select DISTINCT in there? I didn't even look that far, just scanned for the first cursor, hauled it out and posted it.

    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
  • I have to agree whole heartly with Grant on this one. I'd want to get paid to work on that one. Lot of code, not a lot of comments on what is going on. This one could take quite a bit of time that could be put to much better use helping others, or spending time with family and friends (or better yetjust doing my own work).

  • Actually, if I did the search correctly, I found 5 SELECT DISTINCT statements in the code.

    Edit:

    And 3 cursors.

  • Jeff Moden (6/22/2009)


    Does anyone have some apple-sauce? 😛

    Strangely enough, I just picked some up last night...

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • I hope I didn't scare away the newbie on this thread with my Tally table joke... But I HAD to do it... :hehe:



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • lmu92 (6/22/2009)


    I hope I didn't scare away the newbie on this thread with my Tally table joke... But I HAD to do it... :hehe:

    Payment for solutions on a forum? Sounds like experts-exchange 😛

    @jeff: I beat it once in the split thread. Do I get it for free or do I have to pay twice? 😀

  • Jeff Moden (6/22/2009)


    Surprisingly enough, a Cursor would probably be faster than the Triangular Join method of doing the running totals that Carl currently has deployed.

    Not the way I would write it 😉

    Fair point though. 🙂

  • GilaMonster (6/22/2009)


    Anyone want to take a stab at 800+ lines of cursor-ridden, mostly uncommented code?

    http://qa.sqlservercentral.com/Forums/FindPost739170.aspx

    Working on it now. :w00t:

    Was easier than looking at This One

  • Florian Reischl (6/22/2009)


    Payment for solutions on a forum? Sounds like experts-exchange 😛

    Who paid for an expert sex change?

    Or did I misread that?

    😀

    Florian Reischl (6/22/2009)


    @Jeff: I beat it once in the split thread. Do I get it for free or do I have to pay twice? 😀

    Ahem.

  • tosscrosby (6/22/2009)


    ummm.. i think we need to give him fair amount of chance to prove that he's willing to learn.

    Not for me. They were most likely interview or homework questions posted verbatim. YMMV but I chose not to post (though tempted to, as I said before).

    I agree with the broad sentiments in your post however.

Viewing 15 posts - 5,941 through 5,955 (of 66,000 total)

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