performance diff - using a sub query or a view

  • I have a view where I need to use a sub query in the from clause

    select

    :

    :

    from

    (

    select a, b, c from X....

    )

    Is there any perfomance difference if I use the sub-query "(select a, b, c from X.... )" in a view and then use the view in the final query. Is there any performance difference between the view approach and the sub-query approach? I feel that the sub-query performs better. Please advise.

  • DB developers are not allowed to feel anything.

    They must KNOW.

    If they don't know they must TEST.

    Try both ways and see fir yourself.

    _____________
    Code for TallyGenerator

  • After that... drink beer! 😀

    --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 3 posts - 1 through 2 (of 2 total)

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