October 3, 2016 at 8:22 am
While we're on the subject, does anyone know of a reason there could be a performance hit from doing all these cross applies? I'm assuming it makes no real difference to the query plan.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 3, 2016 at 3:31 pm
The Dixie Flatline (10/3/2016)
This is part of an ETL process I'm having to work on replacing. The existing process has rather complicated logic governing when columns can be updated in the target table. The logic varies from column to column, and there are over 100 columns. No I/O from other tables is required by any of the functions. (Yes, I know about case expressions, thanks guys.)Rather than writing and testing a multi-hundred line function with dozens and dozens of parameters, we are leaning towards a separate function for each column to be updated. These could be coded and unit-tested separately.
That's why I was asking. I'm doing the same thing right now and couldn't figure out why you wanted to do such a thing unless it was for the same purpose. Thanks, Bob.
p.s. Great minds think alike. π
--Jeff Moden
Change is inevitable... Change for the better is not.
October 3, 2016 at 4:02 pm
Eirikur Eiriksson (10/3/2016)
Luis Cazares (10/3/2016)
Jeff Moden (10/2/2016)
The Dixie Flatline (9/30/2016)
Fortunately, I only need around 300, not thousands. πThanks guys.
Just curious.... what are you doing that needs so many APPLYs?
He probably needs to make the server beg for mercy. π
Though it might be a case of dyslexia
π
Being slightly perverse, whenever I need permissions I always ask for persimmons instead. π
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 3, 2016 at 4:03 pm
WHOA !! THOSE ARE LARGER THAN LIFE !!!!! :w00t:
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 3, 2016 at 4:42 pm
The Dixie Flatline (10/3/2016)
While we're on the subject, does anyone know of a reason there could be a performance hit from doing all these cross applies? I'm assuming it makes no real difference to the query plan.
So long as they're not "cascading" CROSS APPLYs, you should be OK.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 4, 2016 at 5:55 am
Jeff Moden (10/3/2016)
The Dixie Flatline (10/3/2016)
While we're on the subject, does anyone know of a reason there could be a performance hit from doing all these cross applies? I'm assuming it makes no real difference to the query plan.So long as they're not "cascading" CROSS APPLYs, you should be OK.
Got distracted by the massive orange permissions above. Far better than the miserable weedy specimens I found in Cyprus last week, although the feral figs and pomegranates were superb.
Yes, this is absolutely correct. If the APPLY blocks cascade, and especially if they cascade all the way down, then performance will be similar to that of a gnat learning to swim in molasses. If you want to know why, open up the properties sheet of the compute scalar of the last APPLY block. If you dare.
If your APPLY blocks don't reference tables either, then they will be extremely cheap. I've used this method for data cleansing in the past and it's very cool - maintainable, quick, easy to document.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 4, 2016 at 12:58 pm
Define cascading please. Output from itvf_1 becomes input to itvf_2 ??
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 4, 2016 at 1:05 pm
The Dixie Flatline (10/4/2016)
Define cascading please. Output from itvf_1 becomes input to itvf_2 ??
That's exactly it.
October 4, 2016 at 2:25 pm
The Dixie Flatline (10/4/2016)
Define cascading please. Output from itvf_1 becomes input to itvf_2 ??
http://www.sqlservercentral.com/articles/T-SQL/97545/
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 4, 2016 at 3:58 pm
Good read, Chris. Thanks.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply