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

Bulk insert slower after upgrade in SQL2008 R2 Expand / Collapse
Author
Message
Posted Friday, August 17, 2012 7:47 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 11, 2012 10:33 AM
Points: 144, Visits: 77
We did an inplace upgradeof Production database from sql server 2005 to SQL 2008 R2 with same configured Windows server. After upgraded bulk insert is taking longer. We update stats and rebuild index every day on this specific table.

From application in 2005 it was taking 22 mins to bulkinsert 10,000 Items, but in 2008 its taking 39 mins. While insert is running I am not able to select anything from the database.


Thanks
Dev.

Post #1346547
Posted Friday, August 17, 2012 7:52 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 11, 2012 10:33 AM
Points: 144, Visits: 77
I just did a
select *  from table

in 2005 and 2008.

2005 - it took 35 mins for 16 million rows
2008- took 48 Mins for 16 Million Rows.

I see comptability level is set to 100 in 2008. Will changing this to 90 help?
Post #1346554
Posted Friday, August 17, 2012 2:46 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, July 28, 2014 9:59 AM
Points: 18, Visits: 553
I've seen performance issues come up because of some trace flags that were set or acted differently between versions, e.g. 4199 and 4135. You might try playing around with those. Do you have a test server you can use instead of production?
Post #1346755
Posted Friday, August 17, 2012 3:09 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 11:54 AM
Points: 897, Visits: 7,099
22 minutes for 10,000 rows? You have another problem somewhere. That should be closer to 22 seconds for 10,000 rows.

How big are the rows? Is there a BLOB involved? How many indexes on the table? Is there a trigger on the table?

What's the batch size on the bulk insert? Is there a lot of blocking going on while this is running?




And then again, I might be wrong ...
David Webb
Post #1346765
Posted Friday, August 17, 2012 3:11 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, July 28, 2014 9:59 AM
Points: 18, Visits: 553
Do you see table locks occurring, is that why you can't read from the table when the insert is happening?
Post #1346766
Posted Tuesday, August 21, 2012 2:53 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 11, 2012 10:33 AM
Points: 144, Visits: 77
Hi David,

Sorry that was a tupo, its not 10K items , its 100K items. Considering the fact that we have 16MM records and 33 index on the item table.

Rows have 72 columns. No blob involved. 32 index, 2 delete triggers, 10,000 batch Size. Yes there are lot of blocking going while this is running for any process that uses this table

HI,

Yes we do see table level lock. Other process gets locked when this is running. Insert bulk for 100K rows runs in batches og 10,000.
Post #1348095
Posted Tuesday, August 21, 2012 2:55 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, July 28, 2014 9:59 AM
Points: 18, Visits: 553
Have you tried deleting all the indexes right before the bulk load and recreating them afterwards? That probably wouldn't explain the difference but it should speed things up substantially.
Post #1348098
Posted Tuesday, August 21, 2012 3:22 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 11:54 AM
Points: 897, Visits: 7,099
Do you really need that many indexes? I've seen scenarios where that was appropriate, but they were few and far between.



And then again, I might be wrong ...
David Webb
Post #1348111
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse