IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HESAPISL]') AND 
name = N'IXM_HESAPISL_DASHBOARD_OZETGUNLUK')

CREATE NONCLUSTERED INDEX [IXM_HESAPISL_DASHBOARD_OZETGUNLUK] ON [dbo].[HESAPISL]
(
	[IPTAL] ASC,
	[ONAYLI] ASC,
	[TEKLIF] ASC,
	[ITARIH] ASC,
	[SGODEMEID] ASC,
	[KRMODEMEID] ASC,
	[HSTODEMEID] ASC,
	[DOVIZKODU] ASC,
	[ITEMID] ASC,
	[HESAPISLID] ASC,
	[HDOSYAID] ASC
)
INCLUDE([KRMTUTAR],[OZELTUTAR],[KRMINDORAN],[KRMINDTUTAR],[OZELINDORAN],[OZELINDTUTAR],[OZELODENDI],[KRMODENDI],[KRMPAKETEDAHIL],[HSTPAKETEDAHIL],[HSTKDVORAN],[KRMKDVORAN],[MLYTTUTAR],[SGTUTAR],[SGINDORAN],[SGPAKETEDAHIL],[SGKDVORAN],[OTOOZELISLEMTUTAR],[OTOOZELISLEMINDTUTAR]) 
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HDOSYA]') AND 
name = N'IXM_HDOSYA_DASHBOARD_OZETGUNLUK')

CREATE NONCLUSTERED INDEX [IXM_HDOSYA_DASHBOARD_OZETGUNLUK] ON [dbo].[HDOSYA]
(
	[SUBEID] ASC,
	[HDOSYAID] ASC,
	[HKIMLIKID] ASC,
	[YATISTURUID] ASC
)
INCLUDE([HDYATIYOR]) 
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ODEME]') AND 
name = N'IXM_ODEME_DASHBOARD_OZETGUNLUK')

CREATE NONCLUSTERED INDEX [IXM_ODEME_DASHBOARD_OZETGUNLUK] ON [dbo].[ODEME]
(
	[ODEMEID] ASC,
	[IPTAL] ASC,
	[TOPLAMODEMETUTARI] ASC
)
INCLUDE([KESINTITUTARI],[INDIRIMTUTARI]) 
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ODEME]') AND 
name = N'IXM_ODEME_DASHBOARD_IPTAL_TOPLAMODEMETUTARI')


CREATE NONCLUSTERED INDEX [IXM_ODEME_DASHBOARD_IPTAL_TOPLAMODEMETUTARI]
ON [dbo].[ODEME] ([IPTAL],[TOPLAMODEMETUTARI])
INCLUDE ([KESINTITUTARI],[INDIRIMTUTARI])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]


GO


IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HDOSYA]') AND 
name = N'IXM_HDOSYA_DASHBOARD_KRMNETTUTAR_KRMFATTUTAR')

CREATE NONCLUSTERED INDEX [IXM_HDOSYA_DASHBOARD_KRMNETTUTAR_KRMFATTUTAR]
ON [dbo].[HDOSYA] ([HDIPTAL],[SUBEID],[HDTEKLIF],[HDTARIH],[HDSGKURUMID])
INCLUDE ([HKIMLIKID],[HKCARIID],[HDYATIYOR],[KRMNETTUTAR],[KRMFATTUTAR])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
GO



