• sunny.tjk (9/13/2013)


    The computer that i run queries on has 2 processors. Shouldn't query1 execute faster than query2 ? Surprisingly, both executed taking exact time. Also, on OLTP system, should MAXDOP be disabled or should I leave it as default setting?

    Query1:

    SELECT * FROM table

    UNION

    SELECT * FROM table1

    Query2:

    SELECT * FROM table

    UNION

    SELECT * FROM table1

    OPTION (MAXDOP 1)

    Query1 was using parallelism in the execution plan.

    A part of your "problem" may be that you're returning the output to "The GREAT EQUALIZER"... the display. If you want to test such things, you'll need a large amount of data and some variables to dump each column into to take the display time out of the picture.

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