Identify Query Waiting on resources





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I have some query with CXCONSUMER wait time when i ran sp_whoisactive as shown in the screenshot below.



enter image description here
When i checked the status it is suspended.That means it is waiting for some process to release resource.As far as my understanding CXPACKET is the producer and CXCONSUMER is the consumer and CXPACKET is the main culprit and action should be taken on that.But i don't see any CXPACKET.
Since this is a parallel execution i am not sure where i should start fixing.



Can anyone suggest me how to find out the process on which my queries are waiting(because i see suspended as status)?



Additional Info



When i query sys.dm_os_wait_stats ,the top two entries are CONSUMER and CXPACKETS.




  • SQL Server 2016

  • 128 GB RAM

  • MAX DOP : 8

  • Cost of threshold : 20










share|improve this question


















  • 1





    have you tried brentozar.com/blitz ? It's very usefull and have a part to identify waits (brentozar.com/sql/wait-stats )

    – Danielle Paquette-Harvey
    Jan 4 at 19:17








  • 1





    Check out what Paul Randal says about that wait. He also has some steps on working on CXPACKET as does Brent Ozar but as you said, you don't see this wait type.

    – scsimon
    Jan 4 at 19:28








  • 1





    @scsimon: I don't see CXPACKET when i run sp_whoisactive,i see only CXCONSUMER.I will check the links.

    – user9516827
    Jan 4 at 19:32


















3















I have some query with CXCONSUMER wait time when i ran sp_whoisactive as shown in the screenshot below.



enter image description here
When i checked the status it is suspended.That means it is waiting for some process to release resource.As far as my understanding CXPACKET is the producer and CXCONSUMER is the consumer and CXPACKET is the main culprit and action should be taken on that.But i don't see any CXPACKET.
Since this is a parallel execution i am not sure where i should start fixing.



Can anyone suggest me how to find out the process on which my queries are waiting(because i see suspended as status)?



Additional Info



When i query sys.dm_os_wait_stats ,the top two entries are CONSUMER and CXPACKETS.




  • SQL Server 2016

  • 128 GB RAM

  • MAX DOP : 8

  • Cost of threshold : 20










share|improve this question


















  • 1





    have you tried brentozar.com/blitz ? It's very usefull and have a part to identify waits (brentozar.com/sql/wait-stats )

    – Danielle Paquette-Harvey
    Jan 4 at 19:17








  • 1





    Check out what Paul Randal says about that wait. He also has some steps on working on CXPACKET as does Brent Ozar but as you said, you don't see this wait type.

    – scsimon
    Jan 4 at 19:28








  • 1





    @scsimon: I don't see CXPACKET when i run sp_whoisactive,i see only CXCONSUMER.I will check the links.

    – user9516827
    Jan 4 at 19:32














3












3








3








I have some query with CXCONSUMER wait time when i ran sp_whoisactive as shown in the screenshot below.



enter image description here
When i checked the status it is suspended.That means it is waiting for some process to release resource.As far as my understanding CXPACKET is the producer and CXCONSUMER is the consumer and CXPACKET is the main culprit and action should be taken on that.But i don't see any CXPACKET.
Since this is a parallel execution i am not sure where i should start fixing.



Can anyone suggest me how to find out the process on which my queries are waiting(because i see suspended as status)?



Additional Info



When i query sys.dm_os_wait_stats ,the top two entries are CONSUMER and CXPACKETS.




  • SQL Server 2016

  • 128 GB RAM

  • MAX DOP : 8

  • Cost of threshold : 20










share|improve this question














I have some query with CXCONSUMER wait time when i ran sp_whoisactive as shown in the screenshot below.



enter image description here
When i checked the status it is suspended.That means it is waiting for some process to release resource.As far as my understanding CXPACKET is the producer and CXCONSUMER is the consumer and CXPACKET is the main culprit and action should be taken on that.But i don't see any CXPACKET.
Since this is a parallel execution i am not sure where i should start fixing.



Can anyone suggest me how to find out the process on which my queries are waiting(because i see suspended as status)?



Additional Info



When i query sys.dm_os_wait_stats ,the top two entries are CONSUMER and CXPACKETS.




  • SQL Server 2016

  • 128 GB RAM

  • MAX DOP : 8

  • Cost of threshold : 20







sql-server performance-tuning parallelism blocking waits






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 4 at 19:14









user9516827user9516827

364110




364110








  • 1





    have you tried brentozar.com/blitz ? It's very usefull and have a part to identify waits (brentozar.com/sql/wait-stats )

    – Danielle Paquette-Harvey
    Jan 4 at 19:17








  • 1





    Check out what Paul Randal says about that wait. He also has some steps on working on CXPACKET as does Brent Ozar but as you said, you don't see this wait type.

    – scsimon
    Jan 4 at 19:28








  • 1





    @scsimon: I don't see CXPACKET when i run sp_whoisactive,i see only CXCONSUMER.I will check the links.

    – user9516827
    Jan 4 at 19:32














  • 1





    have you tried brentozar.com/blitz ? It's very usefull and have a part to identify waits (brentozar.com/sql/wait-stats )

    – Danielle Paquette-Harvey
    Jan 4 at 19:17








  • 1





    Check out what Paul Randal says about that wait. He also has some steps on working on CXPACKET as does Brent Ozar but as you said, you don't see this wait type.

    – scsimon
    Jan 4 at 19:28








  • 1





    @scsimon: I don't see CXPACKET when i run sp_whoisactive,i see only CXCONSUMER.I will check the links.

    – user9516827
    Jan 4 at 19:32








1




1





have you tried brentozar.com/blitz ? It's very usefull and have a part to identify waits (brentozar.com/sql/wait-stats )

– Danielle Paquette-Harvey
Jan 4 at 19:17







have you tried brentozar.com/blitz ? It's very usefull and have a part to identify waits (brentozar.com/sql/wait-stats )

– Danielle Paquette-Harvey
Jan 4 at 19:17






1




1





Check out what Paul Randal says about that wait. He also has some steps on working on CXPACKET as does Brent Ozar but as you said, you don't see this wait type.

– scsimon
Jan 4 at 19:28







Check out what Paul Randal says about that wait. He also has some steps on working on CXPACKET as does Brent Ozar but as you said, you don't see this wait type.

– scsimon
Jan 4 at 19:28






1




1





@scsimon: I don't see CXPACKET when i run sp_whoisactive,i see only CXCONSUMER.I will check the links.

– user9516827
Jan 4 at 19:32





@scsimon: I don't see CXPACKET when i run sp_whoisactive,i see only CXCONSUMER.I will check the links.

– user9516827
Jan 4 at 19:32










1 Answer
1






active

oldest

votes


















3














Check out this post from Erik Darling: CXCONSUMER Is Harmless? Not So Fast, Tiger



That shows a really extreme example of a problem query where CXCONUSMER is the highest wait. So while the Microsoft recommendations indicate it's harmless, it definitely can be a sign of other problems.



Based on that, and your screenshot, it's quite possible that you're running into issues with skewed parallelism. You can find some great info about skewed parallelism from Paul Randal: More on CXPACKET Waits: Skewed Parallelism



In theory, waits due to skewed parallelism should be surfaced as CXPACKET waits. This doesn't appear to always be the case in practice at this time though.



Without the query text, and especially an actual execution plan, we can only guess at what might be causing the CXCONSUMER waits for your scenario. But hopefully this helps gives you a direction to look in.



If you edit your question to include the execution plan and query text (and relevant table / index definitions), we can be more help in tracking down the root cause.






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "182"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f226366%2fidentify-query-waiting-on-resources%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Check out this post from Erik Darling: CXCONSUMER Is Harmless? Not So Fast, Tiger



    That shows a really extreme example of a problem query where CXCONUSMER is the highest wait. So while the Microsoft recommendations indicate it's harmless, it definitely can be a sign of other problems.



    Based on that, and your screenshot, it's quite possible that you're running into issues with skewed parallelism. You can find some great info about skewed parallelism from Paul Randal: More on CXPACKET Waits: Skewed Parallelism



    In theory, waits due to skewed parallelism should be surfaced as CXPACKET waits. This doesn't appear to always be the case in practice at this time though.



    Without the query text, and especially an actual execution plan, we can only guess at what might be causing the CXCONSUMER waits for your scenario. But hopefully this helps gives you a direction to look in.



    If you edit your question to include the execution plan and query text (and relevant table / index definitions), we can be more help in tracking down the root cause.






    share|improve this answer






























      3














      Check out this post from Erik Darling: CXCONSUMER Is Harmless? Not So Fast, Tiger



      That shows a really extreme example of a problem query where CXCONUSMER is the highest wait. So while the Microsoft recommendations indicate it's harmless, it definitely can be a sign of other problems.



      Based on that, and your screenshot, it's quite possible that you're running into issues with skewed parallelism. You can find some great info about skewed parallelism from Paul Randal: More on CXPACKET Waits: Skewed Parallelism



      In theory, waits due to skewed parallelism should be surfaced as CXPACKET waits. This doesn't appear to always be the case in practice at this time though.



      Without the query text, and especially an actual execution plan, we can only guess at what might be causing the CXCONSUMER waits for your scenario. But hopefully this helps gives you a direction to look in.



      If you edit your question to include the execution plan and query text (and relevant table / index definitions), we can be more help in tracking down the root cause.






      share|improve this answer




























        3












        3








        3







        Check out this post from Erik Darling: CXCONSUMER Is Harmless? Not So Fast, Tiger



        That shows a really extreme example of a problem query where CXCONUSMER is the highest wait. So while the Microsoft recommendations indicate it's harmless, it definitely can be a sign of other problems.



        Based on that, and your screenshot, it's quite possible that you're running into issues with skewed parallelism. You can find some great info about skewed parallelism from Paul Randal: More on CXPACKET Waits: Skewed Parallelism



        In theory, waits due to skewed parallelism should be surfaced as CXPACKET waits. This doesn't appear to always be the case in practice at this time though.



        Without the query text, and especially an actual execution plan, we can only guess at what might be causing the CXCONSUMER waits for your scenario. But hopefully this helps gives you a direction to look in.



        If you edit your question to include the execution plan and query text (and relevant table / index definitions), we can be more help in tracking down the root cause.






        share|improve this answer















        Check out this post from Erik Darling: CXCONSUMER Is Harmless? Not So Fast, Tiger



        That shows a really extreme example of a problem query where CXCONUSMER is the highest wait. So while the Microsoft recommendations indicate it's harmless, it definitely can be a sign of other problems.



        Based on that, and your screenshot, it's quite possible that you're running into issues with skewed parallelism. You can find some great info about skewed parallelism from Paul Randal: More on CXPACKET Waits: Skewed Parallelism



        In theory, waits due to skewed parallelism should be surfaced as CXPACKET waits. This doesn't appear to always be the case in practice at this time though.



        Without the query text, and especially an actual execution plan, we can only guess at what might be causing the CXCONSUMER waits for your scenario. But hopefully this helps gives you a direction to look in.



        If you edit your question to include the execution plan and query text (and relevant table / index definitions), we can be more help in tracking down the root cause.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 8 at 16:51

























        answered Jan 4 at 19:30









        Josh DarnellJosh Darnell

        7,84022243




        7,84022243






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Database Administrators Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f226366%2fidentify-query-waiting-on-resources%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Wiesbaden

            To store a contact into the json file from server.js file using a class in NodeJS

            Marschland