would using current of cursor improve performance ?

I have a long running program that does a simple thing: reads records from Table A (staging) and loads them to the similarly structured Table B (Production).

I'm looking at all ways to improve performance.

After reading and loading 1 record to Table B-Prod, the corresponding record is updated to reflect "loaded".

the update statement updates based on the primary key (claim_seqno).

Would there be any potential performance improvement by using "current of cursor" ?

Currently it's:
UPDATE ODS.MEM_MEMB_SUB_GRP SET ODS_STUS_CD = 'L'
WHERE
 MEMB_SUB_GRP_SEQNO = 123456

So I would make it
UPDATE ODS.MEM_MEMB_SUB_GRP SET ODS_STUS_CD = 'L'
WHERE current of cursor

. . . and I think I have to make the query "for update"
- I assume this locks the table from updates

LVL 1
Alaska CowboyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sdstuberCommented:
the "for update" clause will cause the rows to be locked

"where current of" should be faster since it doesn't need to requery the table, it already knows where there row is.

faster yet, if possible, write your update as a single statement rather than iterating through all the rows procedurally.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alaska CowboyAuthor Commented:
ok, thanks.
yes, it's possible I can make one big update statement instead of 1 at a time, good idea.
0
Alaska CowboyAuthor Commented:
helps my analysis that I need to present next week.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.