 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
David Guest
|
Posted: Fri Dec 03, 2004 12:41 pm Post subject: bcp vs PreparedStatement insert |
|
|
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
|
Posted: Fri Dec 03, 2004 1:16 pm Post subject: Re: bcp vs PreparedStatement insert |
|
|
"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
|
Posted: Fri Dec 03, 2004 7:16 pm Post subject: Re: bcp vs PreparedStatement insert |
|
|
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
|
|
| Back to top |
|
 |
|
|
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
|
|