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


Improve Performance of Lookup Transformation


Improve Performance of Lookup Transformation

Author
Message
yogi123
yogi123
SSC Veteran
SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)

Group: General Forum Members
Points: 218 Visits: 394
Hello

I need to tune SSIS package.

I use Lookup Transformation for Insert Vs Update Operation on Destination Table.

Every night I ran ETL, From Source Query I got 740K records and I compare some key columns for Insert via Lookup transformation. If its No match then Insert to Destination table through OLE DB Destination else Update some defined column through OLE DB Command.

I got perfect setup that meet the requirement but Problem is Performance.

The Lookup takes a while to finish. Yesterday it took 25 Hours to finish so please help me to Improve Performance for lookup Transformation.

Thanks
Alexander Suprun
Alexander Suprun
Mr or Mrs. 500
Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)Mr or Mrs. 500 (511 reputation)

Group: General Forum Members
Points: 511 Visits: 1516
Insert all 740K into a staging table and then do a MERGE.


Alex Suprun
Orlando Colamatteo
Orlando Colamatteo
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14889 Visits: 14396
Pushing the data to a staging table and applying all changes at once using MERGE is a good performing option.

If you need to stick with Lookup for whatever reason, please post the configuration in the form or a screenshot or detailed posting.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
CozyRoc
CozyRoc
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2366 Visits: 2235
How did you determine the Lookup transformation is what slows you down? I believe the issue is the OLE DB Command transformation. Try loading the update rows into a staging table using the OLE DB Destination component with fast load. Then transfer the updates from staging to the destination table using the standard Execute SQL Task.

---
SSIS Tasks Components Scripts Services | http://www.cozyroc.com/


yogi123
yogi123
SSC Veteran
SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)

Group: General Forum Members
Points: 218 Visits: 394
Hello

I Attach Screen Shot

Please Check it and let me know any thoughts
Attachments
ScreenShot.png (9 views, 180.00 KB)
Phil Parkin
Phil Parkin
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: 18332 Visits: 20414
yogi123 (3/25/2013)
Hello

I Attach Screen Shot

Please Check it and let me know any thoughts


In my opinion, the lookup is unlikely to be the main culprit here. I'd be looking at the sorts and the OLEDB command - both notoriously slow and expensive. Can the sorts be done by the OLEDB source components? If so, get rid of the sort transforms.

Get rid of the OLEDB command component by sending all the no match output rows to a work table and have a final ExecuteSQL MERGE which does the work in a set-based fashion.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Phil Parkin
Phil Parkin
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: 18332 Visits: 20414
Phil Parkin (3/25/2013)
yogi123 (3/25/2013)
Hello

I Attach Screen Shot

Please Check it and let me know any thoughts


In my opinion, the lookup is unlikely to be the main culprit here. I'd be looking at the sorts and the OLEDB command - both notoriously slow and expensive. Can the sorts be done by the OLEDB source components? If so, get rid of the sort transforms.

Get rid of the OLEDB command component by sending all the no match output rows to a work table and have a final ExecuteSQL MERGE which does the work in a set-based fashion.


Oops, apologies - I seem to have almost directly quoted opc.three and Cozyroc.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Orlando Colamatteo
Orlando Colamatteo
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14889 Visits: 14396
Phil is right about the sorts. The way they're bring used they are a size-of-data operation and in most of the instances in your Data Flow you could have the OLE DB Source sort the data for you, and cheaply if you have an existing supporting index, if it is a SELECT-statement and you can add an ORDER BY.

Have you timed the various pieces of the Package to see where the actual bottleneck is? If you;re thinking it is still the lookup please post the details of the configuration, maybe a screenshot of that.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
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