?
Solved

SSIS performance: SSMS Import Data vs BIDS Execute Package

Posted on 2013-06-26
8
Medium Priority
?
574 Views
Last Modified: 2016-02-11
I'm working on an ETL project from SQL 2005 to SQL 2012. I'm starting with a source table that has about 450,000 records. Using the SSMS Import Data Wizard, I specified the source SQL Query as
SELECT Contact_ID, Contact_TS, Sex, Date_Of_Birth FROM Contacts. Contact_TS is a timestamp column which is translated as binary(8) for the target table. The target table is created new with a name of Query. This package runs in just a few seconds.

I then created target tables on the target database for Contacts and other tables including some basic foreign keys, which I disabled using EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all". The target table does have a primary key on Contact_ID but it is not an IDENTITY.

I used BIDS to create a new package which uses the same source query but which inserts to the target Contacts table. When I use the Execute Package Utility to run this package, it takes over 6 minutes to process the exact same number of records. I run it from my development computer, not from the SQL Server machine.

Can someone explain why using Execute Package Utility in this way causes it to take more than 30 times as long? What are my options to make this run more quickly.

For production use, I don't expect to use the Execute Package Utility. I expect it to be scheduled or run from some .NET application or process. But I do need to know that I can get sufficient performance with my packages.

Thanks in advance.
0
Comment
Question by:ZekeLA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39281912
" The target table is created new with a name of Query."

Where was that table created?  In the same database as the source?  On the same server? Or on the same target server as the one you're targeting with your BIDS package?
0
 
LVL 1

Author Comment

by:ZekeLA
ID: 39282348
The target table is created on the target database by the package as expected. Since my original post, I've learned how to create and deploy the package from SSDT (aka BIDS) to the target server's Integration Services Catalogs. When I run the package from there, It takes about 60 seconds which is acceptable. I've also eliminated all primary and foreign keys.

The sixty seconds is probably acceptable for my purposes but I still don't know what the Data Import wizard is doing (or not doing) that makes it an order or two faster than executing my deployed package project.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39282613
What you should take into consideration is that when you launch a package from your PC, either through BIDS or Execute Package Utility, it actually runs on your PC!  So if you've got a source and a destination server, data will travel over the network from the source server to your PC and back again to the destination server.  That probably explains some of the additional delay you've been seeing.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 1

Author Comment

by:ZekeLA
ID: 39282719
OK. That addresses the original problem and we can leave it at that.

But running a package from the target DB's Integration Services Catalog still takes an order of magnitude longer than using the Import Data Wizard:

Package = 92.985 seconds
Wizard = 5 seconds

Any thoughts as to what causes the extreme differences?
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 2000 total points
ID: 39292265
That's a bit difficult to say, too many possibilities.

Perhaps the following is interesting to try out: the last option screen in the Import Data Wizard has got a checkbox that allows you to save the SSIS package which gets generated.  You could save that and then execute it from BIDS or from the server and compare execution speed.  You can also have a closer look at it in BIDS to see how the generated package works, perhaps that explains some difference as well, compared to the one you've implemented?
0
 
LVL 1

Assisted Solution

by:ZekeLA
ZekeLA earned 0 total points
ID: 39297103
Thanks ValentinoV. I did as you suggested and found that the Wizard creates the package using the Fast Load Data Access Mode. Since that's a bulk insert, it is much faster. I'll have to see if I can use that option for my actual package. I'm only appending records from the source query to the target table so it may work. Even if it doesn't, I know why there's a performance difference.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39297237
Glad to hear I could help :)
0
 
LVL 1

Author Closing Comment

by:ZekeLA
ID: 39306589
Expert told me how to find the answer. My response includes the results of that investigation.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question