AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bcp vs PreparedStatement insert

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
David
Guest





PostPosted: Fri Dec 03, 2004 12:41 pm    Post subject: bcp vs PreparedStatement insert Reply with quote



Dear all,

What sort of performance hit do you think I'll suffer if I were to insert
55,000 or so rows using a PreparedStatement vs a system call to the bcp bulk
insert utility?

bcp will insert 55,000 rows in 1/3 of a second.

Cheers,

David


Back to top
Robert Klemme
Guest





PostPosted: Fri Dec 03, 2004 1:16 pm    Post subject: Re: bcp vs PreparedStatement insert Reply with quote




"David" <gyruss (AT) hushmail (DOT) com> schrieb im Newsbeitrag
news:41b05efe$1_1 (AT) news (DOT) iprimus.com.au...
Quote:
Dear all,

What sort of performance hit do you think I'll suffer if I were to
insert
55,000 or so rows using a PreparedStatement vs a system call to the bcp
bulk
insert utility?

bcp will insert 55,000 rows in 1/3 of a second.

That depends on so many factors but I'd say you're likely to see a drop in
performance when you use PS. You should do a test run and measure values.
If your driver supports it, use addBatch()

[url]http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#addBatch([/url])

Kind regards

robert


Back to top
Joe Weinstein
Guest





PostPosted: Fri Dec 03, 2004 7:16 pm    Post subject: Re: bcp vs PreparedStatement insert Reply with quote





David wrote:
Quote:
Dear all,

What sort of performance hit do you think I'll suffer if I were to insert
55,000 or so rows using a PreparedStatement vs a system call to the bcp bulk
insert utility?

bcp will insert 55,000 rows in 1/3 of a second.

The big advantage of BCP (for MS and Sybase) is that it allows the DBMS not to
separately log every insert. All it logs are the page allocations. You could try
batching, but I'm guessing the physical I/O benefit of BCP will win out.
Joe Weinstein at BEA

Quote:

Cheers,

David




Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.