I have two tables that 99% of operation on it is simple select. Rarely we have insert/delete and updates.
There is a inner join on these tables and execution plan of the query is index seek. 99% of times the query run very fast (about 1 second). But there is some times that query longs 30 seconds to run.
There isn't any pattern on when this was happened. One time this happened on '1 dec 3:17:20 am'. One time on '8 dec 10:13:43 pm'. One time happened on '11 dec 16:50:43 pm'.
How can I find clues for where this problem comes from?
Does SQL Server have a tool for logging all events?
My query just has simple where clause: where id = @id.