Andrey,
Instead of explicitly using 'where rowid = ', why not consider the use
'for update of' and 'where current of'?
Raj
Andrey Bronfin
<andreyb@elrontel To: Multiple recipients of list
ORACLE-L <[EMAIL PROTECTED]>
esoft.com> cc:
Sent by: Subject: a quick SQL performance
question - rethinked
[EMAIL PROTECTED]
July 18, 2002
03:35 PM
Please respond to
ORACLE-L
Dear gurus !
I apologize for wasting your time.
I have had a second thought and realized that option (2) is not feasible,
simply because i might "miss" some records, i.e. delete the records that
are
inserted into MYTAB DURING the execution of the cursor.
I.e. , time will pass between the opening of the cursor (i.e. execution of
the cursor's SELECT statement) and between the delete outside the cursor.
Meanwhile , new records will get inserted , which are still unprocessed by
the cursor's business logic.....
So , i must ensure that i delete only the "processed" records , i.e. i must
delete inside the cursor's loop.
Right ?
-----Original Message-----
Sent: Thu, July 18, 2002 8:39 PM
To: Multiple recipients of list ORACLE-L
Dear all !
I've got a cursor , which selects approximately 25% of records in a table
(the total number of records in that table is typically 2 to 20 thousands).
For each record ,fetched in that cursor, i need to do some processing , and
then delete that record.
Now, what's faster:
1) Add the rowid to the fields selected inside the cursor, and issue
"delete
from MYTAB where rowid = ...." , for each record inside the cursor.
or
2) Leave the cursor intact, and just issue one delete statement afterwards,
which will delete all the records , fetched by the cursor.
This operation is executed every couple of seconds, so i want to maximally
optimize it .
Cheers.
I'd very much appreciate a prompt responce.
Thanks a lot ~
DBAndrey
* 03-9254520
* 058-548133
* mailto:[EMAIL PROTECTED]
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Andrey Bronfin
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Andrey Bronfin
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).