if  exists
(
	select* from sys.indexes i where i.[object_id] = OBJECT_ID('AKUZ.T_MEDICAL_RECORD_RELATIONSHIP', 'U') and i.name = 'IX_T_MEDICAL_RECORD_RELATIONSHIP_MedicalRecordLink'
)
	drop index IX_T_MEDICAL_RECORD_RELATIONSHIP_MedicalRecordLink on AKUZ.T_MEDICAL_RECORD_RELATIONSHIP;
go
	CREATE INDEX IX_T_MEDICAL_RECORD_RELATIONSHIP_MedicalRecordLink ON AKUZ.T_MEDICAL_RECORD_RELATIONSHIP(MedicalRecordLink) WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON);

if  exists
(
	select* from sys.indexes i where i.[object_id] = OBJECT_ID('AKUZ.T_MEDICAL_RECORD_RELATIONSHIP', 'U') and i.name = 'IX_T_MEDICAL_RECORD_RELATIONSHIP_RelationshipType'
)
	drop index IX_T_MEDICAL_RECORD_RELATIONSHIP_RelationshipType on AKUZ.T_MEDICAL_RECORD_RELATIONSHIP;
go	
CREATE INDEX [IX_T_MEDICAL_RECORD_RELATIONSHIP_RelationshipType]  ON [AKUZ].[T_MEDICAL_RECORD_RELATIONSHIP] (RelationshipType, MedicalRecord) WITH (FILLFACTOR=95, SORT_IN_TEMPDB=ON);