Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Improve Performance of Lookup Transformation Expand / Collapse
Author
Message
Posted Friday, March 22, 2013 2:24 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 1, 2014 12:13 PM
Points: 115, Visits: 342
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
Post #1434512
Posted Friday, March 22, 2013 3:13 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 2:06 PM
Points: 193, Visits: 946
Insert all 740K into a staging table and then do a MERGE.


Alex Suprun
Post #1434524
Posted Friday, March 22, 2013 3:19 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:27 PM
Points: 7,107, Visits: 12,657
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
Post #1434527
Posted Saturday, March 23, 2013 7:08 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, September 14, 2014 3:17 PM
Points: 1,118, Visits: 2,224
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/

Post #1434639
Posted Monday, March 25, 2013 10:10 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 1, 2014 12:13 PM
Points: 115, Visits: 342
Hello

I Attach Screen Shot

Please Check it and let me know any thoughts


  Post Attachments 
ScreenShot.png (7 views, 180.42 KB)
Post #1435002
Posted Monday, March 25, 2013 10:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:16 AM
Points: 5,078, Visits: 11,856
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1435018
Posted Monday, March 25, 2013 10:31 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:16 AM
Points: 5,078, Visits: 11,856
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1435022
Posted Monday, March 25, 2013 11:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:27 PM
Points: 7,107, Visits: 12,657
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
Post #1435069
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse