SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SORT_INIT causing timeout issues
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shishirkhandekar
Starting Member

23 Posts

Posted - 04/27/2011 :  11:51:37  Show Profile  Reply with Quote
Hello,

We have two pretty complex queries that involve sorting/ordering. Will provide details if required. We were running into timeout issues on these queries. While we do have opportunities to improve them, the interesting part was, in the trace events that we captured to investigate the issue, We notice in the SQL Trace that once the query begins, I see a SQL Transaction event with ObjectName as either GarbageCollection or GhostCleanupTask. This continues for about 30 seconds when the query times out due to the default timeout of the Command object.

The sequence of events is:

SP Statement Starting : Complex query
SQL Transaction: sort_init
SQL Transaction: TVQuery
SQL Transaction: GarbageCollection (We use filestream feature)
SQL Transaction: GhostCleanupTask

Can anyone explain why, for a very complex query, the sort_init would kick in the GC and GCTask ?

Appreciate any help...

Thanks
Shishir Khandekar

shishirkhandekar
Starting Member

23 Posts

Posted - 04/27/2011 :  16:28:55  Show Profile  Reply with Quote
One thing that I forgot to mention was that this happens only when this stored procedure is called from the application tier (.net) and not thru SSMS. We use SQL 2008 R2 RTM, Express Edition.
Go to Top of Page

davidfu
Starting Member

1 Posts

Posted - 09/04/2013 :  23:06:19  Show Profile  Reply with Quote
I have same problem now, and want to know how did you solve it? thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000