We have a transacations log table
Ther are no triggers on this table.
The insert/updates are coming from a ASP.NET web site on a different server. Both the web server and the SQL server are in the same physical location (possibly on the same rack).
The web site call to the database is timing out. Upto 25 edits (INSERTS / UPDATES) are timing out on this every day.
How do I go about identifying and fixing this issue?
I would collect the wait states and queues performance monitor counters to see specifically where the slow downs are occurring. Also, if you can see when the timeouts are occurring, it's possible to get the execution plans for the queries being executed straight out of the cache using DMV's. That way you can see if there's something up with the execution plans for these queries different than the ones that succeed.
answered Oct 21, 2009 at 08:02 PM
Grant Fritchey ♦♦
What isolation level/ table hint are you using ? Read Commited is the default, but read uncommited or using the hint with (nolock) lets you read uncommited 'dirty' data from the destination table ignoring simple locks. ( if locks are your problem, try this).
Does your queries are transactioned ? A safe block of operations within a transaction will place locks on everything you touch, so maybe you dont need this rigid control over a log table.
Check system blocks/ locks and wait types to see if several queries are waiting for any shared resource. Some resource could be locking the table for a long time and causing timeouts.
Maybe you are experiencing IO/CPU/MEMORY/NETWORK bottlenecks ( but usually those problems would afect the whole system.
While updating avoid using any hint like with (tablock).
Check for any pattern of those lost logs, maybe they happen exactly when your full backup operation is running.
Let us know if this help.
answered Oct 21, 2009 at 05:10 PM
Can you give some more info.
Are there any indexes on the table? If so what fields (with data types).
Are there any triggers?
Where are the insert/updates coming from? App on same physical server, another server? What is the connection between the db server and app server?
What is timing out? The query or the call to the database?
answered Oct 21, 2009 at 04:50 PM
Kev Riley ♦♦