Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wonga
Continued Contributor
Continued Contributor

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
v-yuezhe-msft
Employee
Employee

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
v-yuezhe-msft
Employee
Employee

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.
wonga
Continued Contributor
Continued Contributor

Thanks for the clarification @v-yuezhe-msft.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors