I'm trying to speed up a fact table load as part of an overall performance project. The table is just about 120 million rows about 100k are added each evening. The table is pretty heavily indexed.
Currently I'm using an SSIS Fast Load OLE DB destination and loading the 100,000 rows takes about 15 minutes. This seemed really high to me to insert 100k rows, so I altered the package to dump it's results into a staging table, then did an T-SQL insert into the fact table from that staging table. The insert now runs in less than 1 minute.
I found it quite odd that a plain old T-SQL insert would be faster than SSIS Fast Load, so I started looking at which boxes were checked on the OLEDB destination. It turns out Table Lock was NOT checked. When I checked this option, the SSIS load is now under 1 minute. My questions are:
- What are the implications of leaving Table Lock checked?
- Does the T-SQL insert statement issue a table lock by default and that's why it was initially faster?