Determing paralllelism being used for a statement

  • Hi,

    Recently we had a discussion about parallelism. We are currently evaluating different settings. Does somebody have a statement which shows for each statement the amount of parallelism being used?

    I'm sure it's somewhere in dm_exec..

    thanks!

    Wilfred
    The best things in life are the simple things

  • take a look at sys.dm_os_tasks. If a request (session_id,request_id) runs in parallel, it has more than one entries.

    SELECT session_id,request_id,count(*) as Parallel

    FROM sys.dm_os_tasks

    WHERE session_id IS NOT NULL AND request_id IS NOT NULL

    GROUP BY session_id,request_id

  • Thanks, but I don't think this is the right query.

    currrently, MaxDop is set to 2, but this query reported:

    sessionid request_id parallel wanneer

    ----------- ----------- ----------- -----------------------

    374 0 3 2009-11-04 16:31:00

    which indicated SQL is using 3 processors ? :crazy:

    fyi the server has 4 quadcore CPUs

    Wilfred
    The best things in life are the simple things

Viewing 3 posts - 1 through 2 (of 2 total)

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