if exists (select * from sys.indexes i where i.object_id = object_id('AKUZ.T_PLANNED_OPERATION', 'U') and i.name = 'IX_PLANNED_OPERATION_OperationRoom_OperationTime_Includes')
	DROP INDEX IX_PLANNED_OPERATION_OperationRoom_OperationTime_Includes ON AKUZ.T_PLANNED_OPERATION;
go
CREATE INDEX [IX_PLANNED_OPERATION_OperationRoom_OperationTime_Includes] ON [AKUZ].[T_PLANNED_OPERATION] ([OperationRoom], [OperationTime])  INCLUDE ([RouteToOperation]) WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON, MAXDOP = 0);

if exists (select * from sys.indexes i where i.object_id = object_id('AKUZ.T_DIVISION_SERVICE', 'U') and i.name = 'IX_DIVISION_SERVICE_Division_DateEnd_Includes')
	DROP INDEX IX_DIVISION_SERVICE_Division_DateEnd_Includes ON AKUZ.T_DIVISION_SERVICE;
go
CREATE INDEX [IX_DIVISION_SERVICE_Division_DateEnd_Includes] ON [AKUZ].[T_DIVISION_SERVICE] ([Division], [DateEnd])  INCLUDE ([MedicalService]) WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON, MAXDOP = 0);

if exists (select * from sys.indexes i where i.object_id = object_id('AKUZ.T_SCHET_SLUCH', 'U') and i.name = 'IX_SCHET_SLUCH_Type_Include')
	DROP INDEX IX_SCHET_SLUCH_Type_Include ON AKUZ.T_SCHET_SLUCH;
go
CREATE NONCLUSTERED INDEX [IX_SCHET_SLUCH_Type_Include] ON [AKUZ].[T_SCHET_SLUCH] ([type_]) INCLUDE ([Event]) WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON, MAXDOP = 0);

if exists (select * from sys.indexes i where i.object_id = object_id('AKUZ.T_ENTRY_BASE', 'U') and i.name = 'IX_ENTRY_BASE_EntryKind_CreationDateTime_type_')
	DROP INDEX IX_ENTRY_BASE_EntryKind_CreationDateTime_type_ ON AKUZ.T_ENTRY_BASE;
go
CREATE INDEX [IX_ENTRY_BASE_EntryKind_CreationDateTime_type_] ON [AKUZ].[T_ENTRY_BASE] ([EntryKind], [CreationDateTime], [type_])  WITH (FILLFACTOR=100, SORT_IN_TEMPDB=ON, maxdop = 0);