We have a table with few million rows on production. We ran this query and it froze our database,
USE ExampleDatabase
GO
CREATE NONCLUSTERED INDEX IX_Table1_URL
ON [dbo].[Table1] ([URL])
GO
GO
CREATE NONCLUSTERED INDEX IX_Table1_LastModified
ON [dbo].[Table1] ([LastModified])
GO
GO
CREATE NONCLUSTERED INDEX IX_Table2_URL
ON [dbo].[Table2] ([URL])
GO
GO
CREATE NONCLUSTERED INDEX IX_Table2_LastModified2
ON [dbo].[Table2] ([LastModified2])
GO
I am a developer with very limited knowledge of indexes, I am not sure where to start, just to add both Table1 and Table2 have million of rows.