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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
fabricator1
Advocate II
Advocate II

Do model relationships impact SQL queries on SQL Analytics Endpoint / Data Warehouse?

Hi!

I read this thread Solved: Re: Building relationship in Fabric Datawarehouse ... - Microsoft Fabric Community and this documentation article Define relationships in data models for data warehousing - Microsoft Fabric | Microsoft Learn which says that when I am creating relationships in the model view of SQL Analytics Endpoint or Data Warehouse, it is automatically being created PK and FK constraints in the SQL tables in order to increase query speed.

 

I am creating the relationships in the model view, because I want to use them in the Power BI semantic model.

I read in this documentation article Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn that the PK and FK constraints are not enforced. But the article also says that the (not enforced) primary key constraint may lead to inaccurate query results if there are duplicate values in the column which has the PK (not enforced) constraint. 


So it seems that adding relationships may lead to some errors when running SQL queries on the SQL Analytics Endpoint / Data Warehouse - if the data is not in accordance with the assumptions made in the relationships. Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn

 

It seems there are no checks in the Lakehouse or Warehouse that will prevent duplicate values in the primary key column, because the constraints are not enforced.

I'm just trying to understand 😀  Does my understanding seem right, or am I missing something? Thank you!


Ref. also:

Why is default semantic modelling experience insid... - Microsoft Fabric Community

1 ACCEPTED SOLUTION
HimanshuS-msft
Microsoft Employee
Microsoft Employee

Hello @fabricator1 
Thanks for using the Fabric community.

Your undersanding is correct as PK is not enforced the system will not stop you from entering the duplicate again . While you load you will have to make sure that duplicates are NOT inserted into the table , or may be you periodically clean up duplicate by checking on the table .


Thanks
HImanshu

View solution in original post

1 REPLY 1
HimanshuS-msft
Microsoft Employee
Microsoft Employee

Hello @fabricator1 
Thanks for using the Fabric community.

Your undersanding is correct as PK is not enforced the system will not stop you from entering the duplicate again . While you load you will have to make sure that duplicates are NOT inserted into the table , or may be you periodically clean up duplicate by checking on the table .


Thanks
HImanshu

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.