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.

Power Query on SQL - Merge Queries Inner Join breaks Native Query

When building a Query on a SQL Server datasource (and other databases), we can right-click on Steps and see if the View Native Query option is enabled, to be sure that the query up to that step will be sent to the server as a SQL statement (aka "Query Folding"), usually improving performance.

 

When adding a Merge Queries step, if we specify the Join Kind as the default Left Outer Join, the subsequent steps are still "Native Query" steps.  However if we specify Inner Join or others, the subsequent steps are not "Native Query" steps - performance is usually worse.

 

This is unexpected - it's just as easy (easier?) to code an inner join in SQL and most databases, compared to a left outer join.  Some of the other join types also seem easy to code in SQL.

 

We can workaround by adding expand and Filter steps after a left outer join to effectively force an inner join and keep or Native Query alive, but we shouldnt have to.

 

Please add Native Query support for Merge Queries steps that use a Join Type: Inner Join.

Status: Accepted
Comments
v-qiuyu-msft
Community Support

Hi @mike_honey,

 

I have reported this issue internally: CRI 91835838. Will update here once I get any information. 

 

Best Regards,
Qiuyun Yu

v-qiuyu-msft
Community Support
Status changed to: Accepted
 
mike_honey
Memorable Member

great thanks @v-qiuyu-msft - I look forward to the resolution.

v-qiuyu-msft
Community Support

Hi @mike_honey,

 

I got below information: 

 

"If customer try the similar Right join or any other joins except Left in Direct Query mode, they will receive an error regarding the operation not supported in Direct Query mode. This shows that we are not able to fold the queries with Right join (and some other joins). So, in import mode M is returning the results without folding into Native SQL and that is why option is greyed out."

 

Best Regards,
Qiuyun Yu 

mike_honey
Memorable Member

@v-qiuyu-msft - OK, so "they" (Microsoft product team?) seem to confirm the behaviour I described. My actual question is: Can they fix it?  Meaning, can they allow/support at least Inner Join, ideally others?

v-qiuyu-msft
Community Support

Hi @mike_honey,

 

Yes, I reported the issue to product team and they give the response above. 

 

You can submit your feedback here: https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Best Regards,
Qiuyun Yu 

mike_honey
Memorable Member

I give up ...