Hi,
I have a index and a clustered index. below.
In this table in one day 20-30 millions rows comes froma a excel sheet on random basis,due to which the index is fragmented upto 99 % and report fetching is slow also due to this.
I want to rebuild index which take around 5 min to 10 min..
I want to rebuild it every night on schedule but the problem is the bulk insert can start any time and I am not confirm when it will be started and if at same time index rebuild starts then inser can be fail.
Is there any way to rebuild index on schedule so that my bulk insert dont conflict?
CREATE CLUSTERED INDEX [IDX_Custom_raw_trend] ON [dbo].[Custom_Raw_Trend]
(
[HOST_NAME] ASC,
[Descript_ID] ASC,
[Instance] ASC,
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Custom_Raw_Trend](
[TOPO_ID] [varchar](800) NULL,
[IPAddress] [varchar](20) NULL,
[HOST_NAME] [varchar](800) NULL,
[Descript_ID] [varchar](800) NULL,
[Sample_time] [numeric](18, 0) NULL,
[PollInterval] [numeric](18, 0) NULL,
[Instance] [varchar](50) NULL,
[MetricValue] [numeric](18, 2) NULL,
[ID] [int] IDENTITY(1,1) NOT NULL)
Thanks