I have a function that writes 3 lines into a empty table like so:
INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (1, 8, 1)
INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (2, 8, 4)
INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (3, 8, 3)
For some reason only the third query takes a long time to execute - and with each insert it grows longer.
Profiler Image
I have tried disabling all constraints on the table - same result. I just can't figure out why the first two would run so fast - and the last one would take so long.
Any help would be greatly appreciated.
Here is the statistics for a query ran MSSMS:
Query:
ALTER TABLE [dbo].[yaf_ForumAccess] NOCHECK CONSTRAINT ALL
INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (1, 9, 1)
INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (2, 9, 4)
INSERT [dbo].[yaf_ForumAccess] ([GroupID], [ForumID], [AccessMaskID]) VALUES (3, 9, 3)
ALTER TABLE [dbo].[yaf_ForumAccess] CHECK CONSTRAINT ALL
Stats:
Stats