Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!in.100proofnews.com!in.100proofnews.com!feeder2.news.heanet.ie!news.indigo.ie!not-for-mail
Message-ID: <3F33ED6A.8040109@orindaFRUITBATsoft.com>
From: Richard Graham <rgraham@orindaFRUITBATsoft.com>
Organization: Orinda Software
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.misc
Subject: Re: Java Batching & Blobs
References: <c6c61dbf.0308080424.26ba0ab7@posting.google.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 40
Date: Fri, 08 Aug 2003 19:35:22 +0100
NNTP-Posting-Host: 159.134.106.162
X-Complaints-To: abuse@eircom.net
X-Trace: news.indigo.ie 1060367722 159.134.106.162 (Fri, 08 Aug 2003 19:35:22 BST)
NNTP-Posting-Date: Fri, 08 Aug 2003 19:35:22 BST
Xref: newssvr20.news.prodigy.com comp.databases.oracle.misc:130385

Vinnie,

Compared to the overhead of creating a BLOB the overhead of using a 
sequence is almost zero.

If you are concerned about having to issue (say)

"select myseq.nextval from dual"

1000 times you could do worse than:

"select myseq.nextval from bigtable where rownum <= 1000"

where bigtable is a table with a least 1000 rows. You''' get a cursor 
with 1000 unique numbers. This would avoid the sequence-hit-per-row 
problem you are concerned about.

Richard Graham.

> I have this situation:
> We are inserting many rows at a given time.  Part of the data is a
> blob.
> We are using prepared statements & are thinking about batching the
> inserts.
> The problem is the PK is a sequence.  Therefor we must go to the dB
> each time
> to grab the nextval so we can then do the BLOB update.  Can anyone 
> think of anyway to eliminate that extra call to the dB to grab the
> .nextval or is the performance hit small?
> 
> Thanks


-- 
------------------------------------------------------------------------
Remove FRUITBAT for a valid Email address..

www.orindasoft.com - makers of OrindaBuild
which generates Java JDBC access code for calling PL/SQL Procedures.

