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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
pmscorca
Post Partisan
Post Partisan

Primary key for a table is not a physical primary key

Hi,

reading the official documentation it seems that isn't possible to create a physical primary key for a warehouse table.

The related syntax requires to specify the NOT ENFORCED clause; so, there is no uniqueness with respect to the primary key.

Why is it not possible to create a real primary key? Thanks

3 REPLIES 3
burakkaragoz
Resident Rockstar
Resident Rockstar

Hi @pmscorca ,

 

You are correct: in Microsoft Fabric Warehouse (and many distributed data platforms), primary keys are defined with the NOT ENFORCED clause, meaning that uniqueness is not physically enforced at the storage level. This architectural choice is due to the distributed Delta Lake foundation. Enforcing constraints such as primary keys across distributed nodes would add significant performance and scalability overhead, so these keys are treated as metadata only.

If you need true data uniqueness or referential integrity, the recommended approach is to implement these checks during your data ingestion or transformation processes. You can use tools such as Dataflows, Pipelines, or custom SQL scripts to validate and clean your data before it lands in the warehouse.

References:

Hope this helps clarify the design! If this post was helpful, please consider giving kudos and marking it as solution to assist others in the community.

 

Hi, thanks for your reply.

It's curious that Fabric SQL Database seems to support the primary keys and it is a Fabric workload inside the same ecosystem of a Warehouse. In this case, no overhead?

Thanks

v-vpabbu
Community Support
Community Support

Hi @pmscorca,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

 

Fabric Warehouse is built on a distributed Delta Lake architecture, which is optimized for performance and scalability. Enforcing constraints like primary keys across distributed nodes would introduce significant overhead, so they are defined as metadata only and not physically enforced.

 

If you need to ensure data uniqueness or maintain referential integrity, you’ll need to handle it within your ETL/ELT process—using Dataflows, Pipelines, or custom SQL logic to validate and clean the data as it moves through your system.


If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!


Regards,
Vinay Pabbu

Helpful resources

Announcements
May FBC25 Carousel

Fabric Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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