Top n Used with Order by & performance

  • I know you people are contributing to the forum & we all appreciate that

    Thanks for all your reply

    I will look into this & if required will post again

    Jeff Moden

    I myself don't like to reply whos post is having more lines as this requires you to understand each line & then give any solution if you have. That's why i have given simple query where i don't want to use order by clause & use index instead to return data in the same way.

    Everybody is having problem with deadline & that's y i have post "Waiting" just to draw attention of people who knows otherwise this forum is getting around 10-50 query everyday.

    Thanks again

  • Manish,

    I appreciate your attempt at simplification of the problem ... but you at least need to say that your real code has 10-12 tables up front because the code you posted showed absolutely no problem

    So far as the "waiting" message goes, yeah, we know you're waiting for a reply and what you posted didn't look real friendly...

    quote

    Waiting for reply

    ...it's also called a "bump" and there's nicer ways to do that... maybe I'm just misinterpreting the brevity of the message

    By the way... I think you'll find the real problem is the fact that you're using a view... lot's of times, the view must fully materialize in order to do an ORDER BY, even if it's not on a column in the view, or even just a TOP especially if the view is a non-indexed view that has aggragates.

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

Viewing 2 posts - 16 through 16 (of 16 total)

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