Getting a “operation time out” when indexing tables in MS SQL Server
I am attempting to create an Index on one of my tables. I keep getting "operation timed out". Why is this?
I am attempting to create an Index on one of my tables. I keep getting "operation timed out". Why is this?
Are you running the index creation on a remote database or is it on the local laptop? If you are accessing a remote database then the error message may relate to a network congestion.
Can you try logging on to the server and executing the query ?
I am actually logged on to the database server via Microsoft Remote Desktop.
I am using the Microsoft SQL Server Management Studio to run the query. I am surprised that index creation is timing out when I am executing it directly on the server!
Hmmm, ok. Can you let me know how many records are there in the table you are referring to? If possible, can you paste the Create table statement as well?
The table contains 23,774,277 records. That is about 23 million records.
CREATE TABLE [mobileRegistry](
[registryId] [int] IDENTITY(1,1) NOT NULL,
[registryDate] [datetime] NOT NULL,
[wardName] [nvarchar](20) NOT NULL,
[createdDate] [datetime] NULL,
[status] [int] NULL CONSTRAINT [DF_status] DEFAULT ((1)),
CONSTRAINT [PK_1] PRIMARY KEY CLUSTERED
(
[registryId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
23 Million records is actually a whopping big number of records!
What I can suggest is that:
This way the index will be adjusted as and when the data is added. Feeding an ordered set of data will speed up the index allocation as it will minimize the index from being shifted.
Thank you Stella,
I will try your solution. It will take a while though! I will post the findings here. Wish me luck!
Stella,
Your suggestion worked beautifully. I created the table and transferred the data! No timeouts!
Glad to be of help! Have a nice day!