cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wonga Established Member
Established Member

DirectQuery slows down database

Hey all,

 

I was testing out DirectQuery with a relatively complex query and was told that my query was slowing down the database at an alarming rate. This was even after I closed Power BI.

 

How do I kill the query attempt from Power BI while using DirectQuery if closing the application doesn't do it? Does the query have to be canceled on the database side?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: DirectQuery slows down database

Hi @wonga,

You are connecting to SQL Server database vis DirectQuery mode in Power BI Desktop, right?

 

If that is the case, we are not able to kill the query attempt from Power BI Desktop and closing Desktop doesn’t complete this task. Yes, we would need to kill the query in SQL Server. You can use SQL Server Profiler to capture SPID of the query process, make sure you choose the following T-SQL event and columns when creating trace in Profiler.
1.PNG

Then execute the following T-SQL statement in SQL Server to kill the query. For more details about how to use KILL command in SQL Server, please review this article: https://msdn.microsoft.com/en-us/library/ms173730.aspx .

Kill {SPID value}


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Moderator v-yuezhe-msft
Moderator

Re: DirectQuery slows down database

Hi @wonga,

You are connecting to SQL Server database vis DirectQuery mode in Power BI Desktop, right?

 

If that is the case, we are not able to kill the query attempt from Power BI Desktop and closing Desktop doesn’t complete this task. Yes, we would need to kill the query in SQL Server. You can use SQL Server Profiler to capture SPID of the query process, make sure you choose the following T-SQL event and columns when creating trace in Profiler.
1.PNG

Then execute the following T-SQL statement in SQL Server to kill the query. For more details about how to use KILL command in SQL Server, please review this article: https://msdn.microsoft.com/en-us/library/ms173730.aspx .

Kill {SPID value}


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

wonga Established Member
Established Member

Re: DirectQuery slows down database

Thanks for the clarification @v-yuezhe-msft.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Top Kudoed Authors
Users Online
Currently online: 316 members 3,666 guests
Please welcome our newest community members: