huge table load with 16 columns composite primary key
hi all, i have one table with huge data 10 million , everytime i need to truncate and load this table. we have composite primary key on 16 columns. probably that is why this is taking more time to load than the other tables with comparitvely less number of records.can anyone please suggests what could be the approach to make the ETL process fast. given the fact that i have implemented multithreading as well. ThanksTarni
June 13th, 2011 2:45am

What version you are using? http://blogs.msdn.com/sqlserverstorageengine/archive/2008/03/23/minimal-logging-changes-in-sql-server-2008-part-2.aspx ---Minimal Logging changes i http://sqlblog.com/blogs/davide_mauri/archive/2011/06/11/how-the-number-of-indexes-built-on-a-table-can-impact-performances.aspx Have you tried SSIS package with OLEDB provider which has fast load option?Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 3:12am

uri, i am using 2008 enterprise edition of SQL Server. and yes i am using SSIS with "OpenRowset Using FastLoad"as access. also there are 8 parallel threads in my package, to load the same table. ThanksTarni
June 13th, 2011 3:19am

Hi, Have you tried truncating the data, dropping the Primary Key, importing the data, and then recreating the PK? Aside from the ETL process you may want to change the PK to a surrogate key based on a big int, auto incrementing. Then use the 16 columns to form the clustered index. Having a 16 column primary key can cause problem if you start building other indexes on the table. Seth http://lqqsql.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 8:49am

Tarni Is that possible to drop the index/key before loading and re-create after?Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
June 13th, 2011 8:51am

Hi Uri, thanks for reply. yes in my package i am first droping the index, then truncating the table and after load i am creating the index. Thanks Tarni
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 9:43am

Seth, yes exactly i am doing the same truncating the data, dropping the Primary Key, importing the data, and then recreating the PK. but creating the pk with 16 column is requirement, that probably i can not change. ThanksTarni
June 13th, 2011 9:45am

Take another look at Seth's suggestion, add an identity surrogate key, make sure your 16-field PK is nonclustered, then make the identity your clustered index. Actually, do the clustered index first! Making sure you understand the difference between clustered key and primary key is important here. How long is it currently taking? Another thing to try - if possible, get your data sent to you for import already sorted. Josh
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 11:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics