SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Slow Performance on giant derived table

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Slow Performance on giant derived table
Author Message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Slow Performance on giant derived table Reply with quote
This has been an ongoing issue. In SSMS, imagine you have

Select
From (40,000 lines of Select UNION ALL query) as t
Inner Join


After you hit space, it basically freezes SSMS until it parses the entire thing. I just wanted to throw it out there. Basically derived tables aren't allowed to be very complex so parsing to the first UNION ALL would give you all the columns you need. This info might lead to other parsing enhancements.
Tue Jul 08, 2014 2:39 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Reply with quote
Unless that first SELECT from which the derived table is derived is complex itself :)
Tue Jul 08, 2014 3:36 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
Well you know that the SQL in the editor is a bunch of derived tables. SQL Assistant doesn't know that, it needs to parse the entire thing to find out where each statement starts and ends, including the main query.

Also, if syntax checking is enabled it may take a long time too, just to send the code to the database, have it check it, and het and parse results.

Honestly I'm not sure the issue can be resolved easily. I'm thinking it might be easier to optimize the 40k lines long SQL statements and cut it down to a few lines of code, converting the repeating sub queries to table data and pulling that with a join, or using dynamic SQL within a loop.
Tue Jul 08, 2014 5:22 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.