hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
1.94k stars 1.3k forks source link

Poor index generation on SQL Server #6034

Closed tadgh closed 1 week ago

tadgh commented 1 week ago

Indexes at play:

Problem

  The SQL Server dialect creates a filtered index on any unique indexes that contain a nullable column. On Non-partitioned systems, this causes all data to be omitted from the index, as the partition is null

  It creates an index create statement with a WHERE clause, creating a filtered index, which causes very poor performance on partitioned servers.

Solution Design