Identify Query Waiting on resources












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

334110




334110








  • 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



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





















  • 1





    But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

    – Aaron Bertrand
    Jan 4 at 19:40






  • 1





    @AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

    – jadarnel27
    Jan 4 at 19:55











  • I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

    – Aaron Bertrand
    Jan 4 at 20:42













  • @AaronBertrand Oh! Sorry, I'm following you now.

    – jadarnel27
    Jan 4 at 21:00











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



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





















  • 1





    But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

    – Aaron Bertrand
    Jan 4 at 19:40






  • 1





    @AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

    – jadarnel27
    Jan 4 at 19:55











  • I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

    – Aaron Bertrand
    Jan 4 at 20:42













  • @AaronBertrand Oh! Sorry, I'm following you now.

    – jadarnel27
    Jan 4 at 21:00
















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



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





















  • 1





    But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

    – Aaron Bertrand
    Jan 4 at 19:40






  • 1





    @AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

    – jadarnel27
    Jan 4 at 19:55











  • I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

    – Aaron Bertrand
    Jan 4 at 20:42













  • @AaronBertrand Oh! Sorry, I'm following you now.

    – jadarnel27
    Jan 4 at 21:00














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



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



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 Jan 4 at 22:01









Erik Darling

21.2k1264104




21.2k1264104










answered Jan 4 at 19:30









jadarnel27jadarnel27

3,9971330




3,9971330








  • 1





    But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

    – Aaron Bertrand
    Jan 4 at 19:40






  • 1





    @AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

    – jadarnel27
    Jan 4 at 19:55











  • I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

    – Aaron Bertrand
    Jan 4 at 20:42













  • @AaronBertrand Oh! Sorry, I'm following you now.

    – jadarnel27
    Jan 4 at 21:00














  • 1





    But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

    – Aaron Bertrand
    Jan 4 at 19:40






  • 1





    @AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

    – jadarnel27
    Jan 4 at 19:55











  • I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

    – Aaron Bertrand
    Jan 4 at 20:42













  • @AaronBertrand Oh! Sorry, I'm following you now.

    – jadarnel27
    Jan 4 at 21:00








1




1





But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

– Aaron Bertrand
Jan 4 at 19:40





But if skewed parallelism is the issue, it should be surfacing as CXPACKET and not CXCONSUMER - that was the whole point of the new wait type.

– Aaron Bertrand
Jan 4 at 19:40




1




1





@AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

– jadarnel27
Jan 4 at 19:55





@AaronBertrand Maybe there is something wrong with the implementation of the wait then? I'm not sure. Looking at Erik's blog post, check out the image near the end. There's definitely massive skew. But maybe that's not strictly the problem.

– jadarnel27
Jan 4 at 19:55













I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

– Aaron Bertrand
Jan 4 at 20:42







I know, I'm agreeing, it should be surfaced differently. But there may be more to this scenario (and Erik's). The fact that CXPACKET is high in wait stats but isn't being "caught" suggests there is some timing issue or something else going on.

– Aaron Bertrand
Jan 4 at 20:42















@AaronBertrand Oh! Sorry, I'm following you now.

– jadarnel27
Jan 4 at 21:00





@AaronBertrand Oh! Sorry, I'm following you now.

– jadarnel27
Jan 4 at 21:00


















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

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?