Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Bulk insert slower after upgrade in SQL2008 R2


Bulk insert slower after upgrade in SQL2008 R2

Author
Message
Deviprasad
Deviprasad
SSC-Enthusiastic
SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)

Group: General Forum Members
Points: 144 Visits: 82
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.
Deviprasad
Deviprasad
SSC-Enthusiastic
SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)

Group: General Forum Members
Points: 144 Visits: 82
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?
AlBran LVP
AlBran LVP
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 672
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?
David Webb-CDS
David Webb-CDS
SSC Eights!
SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)

Group: General Forum Members
Points: 918 Visits: 8584
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
AlBran LVP
AlBran LVP
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 672
Do you see table locks occurring, is that why you can't read from the table when the insert is happening?
Deviprasad
Deviprasad
SSC-Enthusiastic
SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)SSC-Enthusiastic (144 reputation)

Group: General Forum Members
Points: 144 Visits: 82
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.
AlBran LVP
AlBran LVP
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 672
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.
David Webb-CDS
David Webb-CDS
SSC Eights!
SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)

Group: General Forum Members
Points: 918 Visits: 8584
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search