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
    4 hours ago








  • 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
    4 hours ago








  • 1




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
















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
    4 hours ago








  • 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
    4 hours ago








  • 1




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














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 4 hours ago









user9516827

337110




337110








  • 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
    4 hours ago








  • 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
    4 hours ago








  • 1




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














  • 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
    4 hours ago








  • 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
    4 hours ago








  • 1




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








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
4 hours ago






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
4 hours ago






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
4 hours ago






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
4 hours ago






1




1




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




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










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
    4 hours ago






  • 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
    3 hours ago










  • 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
    3 hours ago












  • @AaronBertrand Oh! Sorry, I'm following you now.
    – jadarnel27
    2 hours ago











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
    4 hours ago






  • 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
    3 hours ago










  • 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
    3 hours ago












  • @AaronBertrand Oh! Sorry, I'm following you now.
    – jadarnel27
    2 hours ago
















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
    4 hours ago






  • 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
    3 hours ago










  • 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
    3 hours ago












  • @AaronBertrand Oh! Sorry, I'm following you now.
    – jadarnel27
    2 hours ago














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 1 hour ago









Erik Darling

21k1263103




21k1263103










answered 4 hours ago









jadarnel27

3,6901330




3,6901330








  • 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
    4 hours ago






  • 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
    3 hours ago










  • 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
    3 hours ago












  • @AaronBertrand Oh! Sorry, I'm following you now.
    – jadarnel27
    2 hours ago














  • 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
    4 hours ago






  • 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
    3 hours ago










  • 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
    3 hours ago












  • @AaronBertrand Oh! Sorry, I'm following you now.
    – jadarnel27
    2 hours ago








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
4 hours ago




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
4 hours ago




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
3 hours ago




@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
3 hours ago












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
3 hours ago






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
3 hours ago














@AaronBertrand Oh! Sorry, I'm following you now.
– jadarnel27
2 hours ago




@AaronBertrand Oh! Sorry, I'm following you now.
– jadarnel27
2 hours ago


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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

Eastern Orthodox Church

Zagreb

Understanding the information contained in the Deep Space Network XML data?