Unix Technical Forum

Slow Insert in SQL Server

This is a discussion on Slow Insert in SQL Server within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, It takes 4 minutes to insert 40 000 records on a SQL Server and 40 sec on an ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 09:10 PM
Volks
 
Posts: n/a
Default Slow Insert in SQL Server

Hi,

It takes 4 minutes to insert 40 000 records on a SQL Server and 40 sec
on an other SQL Server. The slower run on windows 2000 terminal server
and the faster on windows 2000. The slower The slower have 2 Go of
ram, the faster 512 Mo!!!

How to diagnostic what's going wrong on the slower server? I can't
change the application who do the insertions.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 09:10 PM
DA Morgan
 
Posts: n/a
Default Re: Slow Insert in SQL Server

Volks wrote:
> Hi,
>
> It takes 4 minutes to insert 40 000 records on a SQL Server and 40 sec
> on an other SQL Server. The slower run on windows 2000 terminal server
> and the faster on windows 2000. The slower The slower have 2 Go of
> ram, the faster 512 Mo!!!
>
> How to diagnostic what's going wrong on the slower server? I can't
> change the application who do the insertions.


That is amazingly slow. Using a different commercial database product,
on my slightly anemic IBM ThinkPad (2GB RAM) I just id 40,000 inserts
in 0.14sec.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 09:10 PM
Roy Harvey
 
Posts: n/a
Default Re: Slow Insert in SQL Server

Compare the hard drive configurations. SQL Server is, after all, a
database system, and disk performance is overwhemlingly important.
More important than CPU or memory for a single load process. Factors
that could slow such a process down include logs not isolated on their
own drives and RAID 5, always slow on writes. Of course combining
those two could be particularly bad.

Next, where is the data coming from? Over the network? From another
hard drive on the same server? From the same hard drive as the
database files? Is the location of the data the same for both
servers?

Roy Harvey
Beacon Falls, CT

On 16 Aug 2006 12:36:04 -0700, "Volks" <patrick.simard@isac-inc.com>
wrote:

>Hi,
>
>It takes 4 minutes to insert 40 000 records on a SQL Server and 40 sec
>on an other SQL Server. The slower run on windows 2000 terminal server
>and the faster on windows 2000. The slower The slower have 2 Go of
>ram, the faster 512 Mo!!!
>
>How to diagnostic what's going wrong on the slower server? I can't
>change the application who do the insertions.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 09:11 PM
Jack Vamvas
 
Posts: n/a
Default Re: Slow Insert in SQL Server

1.Run Processor -> % Processor Time
SQLServer:SQL Statistics -> Batch Requests/sec
over the period of the INSERTS

2.Are these INSERTS coming from an app over a network?




----
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________


"Volks" <patrick.simard@isac-inc.com> wrote in message news:1155756964.614937.145000@h48g2000cwc.googlegr oups.com...
> Hi,
>
> It takes 4 minutes to insert 40 000 records on a SQL Server and 40 sec
> on an other SQL Server. The slower run on windows 2000 terminal server
> and the faster on windows 2000. The slower The slower have 2 Go of
> ram, the faster 512 Mo!!!
>
> How to diagnostic what's going wrong on the slower server? I can't
> change the application who do the insertions.
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-29-2008, 09:11 PM
Dan Guzman
 
Posts: n/a
Default Re: Slow Insert in SQL Server

> It takes 4 minutes to insert 40 000 records on a SQL Server

This performance is exactly what I would expect when each insert is done in
an individual transaction and there is no write caching. A physical
transaction log write is required during COMMIT to guarantee that data are
permanently persisted and a disk can typically sustain only 150-200 I/Os per
second.

Server grade hardware usually has write-caching that greatly improves write
performance while ensuring persistence (e.g. controller cache battery
backup). However, you can probably improve performance greatly with your
current configuration by performing the inserts in a single transaction.
This ought allow you to achieve the kind of performance Daniel alluded do.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Volks" <patrick.simard@isac-inc.com> wrote in message
news:1155756964.614937.145000@h48g2000cwc.googlegr oups.com...
> Hi,
>
> It takes 4 minutes to insert 40 000 records on a SQL Server and 40 sec
> on an other SQL Server. The slower run on windows 2000 terminal server
> and the faster on windows 2000. The slower The slower have 2 Go of
> ram, the faster 512 Mo!!!
>
> How to diagnostic what's going wrong on the slower server? I can't
> change the application who do the insertions.
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:05 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com