I am working to increase the performance of bulk loads; 100's of millions of records + daily.
I moved this over to use the IDatareader
interface in lieu of the data tables and did get a noticeable performance boost (500,000 more records a minute). The current setup is:
- A custom cached reader to parse the delimited files.
- Wrapping the stream reader in a buffered stream.
- A custom object reader class that enumerates over the objects and implements the
IDatareader
interface. - Then
SqlBulkCopy
writes to server
The bulk of the performance bottle neck is directly in SqlBulkCopy.WriteToServer
. If I unit test the process up to but excluding just the WriteToServer
the process returns in roughly 1 minute. WriteToServer
is taking on an additional 15 minutes +. For the unit test it is on my local machine so the same drive the database lives on so it's not having to copy the data across the network.
I am using a heap table (no indexes; clustered or unclustered; I have played around various batch sizes without major differences in performance).
There is a need to decrease the load times so I am hoping someone might now a way to squeeze a little more blood out of this turn-up.