|
-
Agreed - in truth, the code (very big to post, but anyway) is like :
CREATE PROCEDURE P(PAR_CUSTOMER in number) IS
cursor C_big_cursor IS select nnn FROM very_big_table1, very_big_table2
where nnnnn ....
and CUSTOMER=PAR_CUSTOMER;
BEGIN
for r in select * from C_big_cursor loop
if condition ...
insert into tab1...
elsif ....
update...tab2
if condition2 ...
update...tab1..
and lots more DMLs and sub-selects, with very complicated logics....
...
end loop;
END;
and in some days I have many simultaneous sessions executing the same procedure, each one using one customer id. Of course, I can have various records for various customers in a given Oracle block, so when the first session is modifying one record in the block, the block is latched, and the others sessions waiting to modify others records in the same block must wait.
True, if some part of this could be executed as a unique SQL statement in just one session the waits would drop drastically, but it´s not the case, mainly due the complicated logic needed. I´m investiganting the possibility of reverse indexes (the PKs are generated by sequences, and the access is by index), but apart this I´m short of other ideas, any comments will be mostly welcome and appreciated.
[]s
Chiappa
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|