Forum Discussion
Usage of Table.View in TSQL query in dataflow
I will leave this thread open, in case someone wants to contribute.
The only thing that worked for me was to divide the sql queries in parts using cte and insert each cte s in corresponding table variable (by default the column schema needs to be mentioned), did not make any impact when I ran that on SSMS, returned the result with exactly same time as before. But, for Power query it made a world of difference, returned my result at the same time as SSMS. Not sure, what is going on inside PQWRY while it attempts to evaluate a SQL query. But I find it inconvenient to divide my queries in smaller parts and have them inserted in a table variable for a query that takes lesser than <10 minutes on server side. Why PQWRY can't evaluate that at the same time?
jennratten - thanks for looking into it.
In your original dataflow that ran for 10 min and then displayed Evaluation was Cancelled, have you tried just saving and closing the dataflow? - No it did not strike me as a doable option, will try out next time if I have a similar situation and let you know how it goes.
especially if query folding is taking place - There is no query folding to take place here at all (to my knowledge) as I am running a native SQL query. Query folding only happens if you transform data using Power Query's syntax and the enging translates back the pqwry to the native query to the foldable source. The reason why I am avoiding query folding casue I want to write a native query so that I can overcome power query's perfomance issue altogether.
I have several queries in dataflows that timeout when I try to preview them in the editor but run just fine in minutes or sometimes just seconds when the dataflow is refreshed. - good to know
Here is where you can change the timeout- this does not have the capacity to overwrite server's default timeout
Here is some additional information for you...
This is a snip of a dataflow that uses a SQL native query and shows that query folding is taking place.
Some helpful pages on dataflows, query folding and the enhanced compute engine.
https://ssbipolar.com/2019/10/12/power-bi-dataflows-and-query-folding/
https://powerbi.microsoft.com/en-us/blog/step-folding-indicators-for-power-query-online/