SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Anatomy of an Incremental Load


Anatomy of an Incremental Load

Author
Message
Andy Leonard
Andy Leonard
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1146 Visits: 1095
Comments posted to this topic are about the item Anatomy of an Incremental Load

Andy Leonard
Data Philosopher, Enterprise Data & Analytics
Matt Miller (4)
Matt Miller (4)
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12355 Visits: 18574
Nice in-depth article.

Just curious - do you have any metrics as to how efficient this is? DTS has gotten a black eye in the past as to being less performant than more streamlined tools like bcp or bulk insert, and SSIS seems to be getting hit with it just by being its replacement. The process you're describing seems to be very efficient process-wise; I just don't have anything that big to load up these days to get an idea of how well this behaves?

Never mind for now the ease of setting this up - I can see how much faster it would be to set one of these up than the "manual way"...

----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Andy Leonard
Andy Leonard
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1146 Visits: 1095
Thanks Matt!

I don't use DTS (or competing products) enough these days to speak about how SSIS performs when compared to them. I can tell you:

1. In general SSIS is way faster than DTS. In tests I did with the Beta versions of SSIS I saw a typical 20% - 40% performance boost. When coupled with an upgrade from SQL Server 200 to 2005, I saw those numbers increase even more. SSIS gives you more and different options for piping data through the enterprise so it is possible to achieve much better performance.
2. Staging updates makes a measurable impact in incremental loads compared to using the OLE DB Command.

:{> Andy

Andy Leonard
Data Philosopher, Enterprise Data & Analytics
Matt Miller (4)
Matt Miller (4)
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12355 Visits: 18574
Cool! I will have to see if I can run the next "big one" I get this way to get a feel, but it sounds like performance has definitely been improved.

Thanks!

----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
rainer.kroos
rainer.kroos
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 49
Hi Andy,
one case is missing in your article: deleted rows (rows in the database but no longer in the input data).
And just another question: do you really think that comparing the whole data between two tables is faster then truncating a table and reloading it complete (if you have a time windows for doing this, of course)?
Until now, I have such a time window but after reading your article I think about loading data by your way, because it is the best way to have all data 24x7 online.
Thanks a lot.

Rainer kroos
nahk.fussuy
nahk.fussuy
SSC-Enthusiastic
SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)SSC-Enthusiastic (108 reputation)

Group: General Forum Members
Points: 108 Visits: 252
just a wee thought on this article. Surely what you are talking us through here is the same as is accomplished by the Slowly changing dimension 'box' . Which automagically creates all the tsql to do the updates,additions and deletions. With support for keeping a history of changes.

It's quite a mad one but a bit of reading up on slowly changing dimensions really helps! Smile
fuller.artful
fuller.artful
SSC Journeyman
SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)

Group: General Forum Members
Points: 81 Visits: 165
Good introduction to SSIS! One thing you wrote surprised me: that using a select statement would be faster than using a view. I don't understand why this is the case.

Since you promised that this would be the first of a collection of articles on SSIS, I would like you to address a situation in which either the input or the output is not SQL Server. For my own purposes, I would like a demonstration of how to handle output to another database such as DB2 or MySQL.

Thanks for a nice article.

Arthur

Arthur Fuller
cell: 647-710-1314

Only two businesses refer to their clients as users: drug-dealing and software development.
-- Arthur Fuller
Andy Leonard
Andy Leonard
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1146 Visits: 1095
Great comments!

Rainer: Deleted rows can be correlated with a Right Join instead of a Left Join, and Filtered the same as New Rows. For the Delete action I stage the rows (much like the Updates) and run a set-based query after the Data Flow.
I do believe loading incrementally is faster than than truncating and reloading in any database that is scaling, or is of sufficient size and experiencing a certain threshold of changes (this is my way of quoting Andy Warren: "It Depends" Wink).

Surely what you are talking us through here is the same as is accomplished by the Slowly changing dimension 'box' .


Yussuf: Yep - it's a lot of the same stuff accomplished with the SCD transformation (optimized some). Unless you're familiar with the concepts of ETL for Kimball-based databases, the SCD Wizard can be a bit intimidating. You essentially work through the same thought process you would work through here, but it looks different to the first-time developer. I would say the converse is more accurate: "the SCD is a very cool wrapper for incremental loads."

...using a select statement would be faster than using a view.


Arthur: Gosh I hope I didn't say that. If I did, forgive me. I argue against selecting a Table or View by name from the dropdown in the same way I argue against writing T-SQL with "Select *..." at the beginning. Extra lookups take place for column names and the like when you execute "Select *". The same applies in SSIS which is, after all, executing SQL against the database.

:{> Andy

Andy Leonard
Data Philosopher, Enterprise Data & Analytics
craigpessano
craigpessano
SSCertifiable
SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)

Group: General Forum Members
Points: 5016 Visits: 2276
yussuf.khan (2/11/2008)
just a wee thought on this article. Surely what you are talking us through here is the same as is accomplished by the Slowly changing dimension 'box' . Which automagically creates all the tsql to do the updates,additions and deletions. With support for keeping a history of changes.

It's quite a mad one but a bit of reading up on slowly changing dimensions really helps! Smile


In my experience the SCD is not very efficient once you get above a thousand rows or so. As the name implies, the SCD is targeted at tables that do not change often, and dimension tables are typically on the small side. It works great and I've used it, but in the right situations. Andy's approach probably scales a lot better.

Nice article Andy!



Jack Corbett
  Jack Corbett
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18638 Visits: 14899
This may relate a littel to Arthur's comment about loading to another RDBMS or from another RDBMS or even another server. If you are loading from a system that you cannot join between the source and destination tables would you use a lookup, then the conditional split, or stage all the data in SQL Server and then load into the destination using the method you show here?



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search