 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
Slow Performance on giant derived table |
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Unless that first SELECT from which the derived table is derived is complex itself :)
|
|
Tue Jul 08, 2014 3:36 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
|
|
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
|
|
|