Saturday, May 8, 2010

Someone trying to outperform Oracle's cache

The following code is from a migration project I'm working on. It is part of a package named PERFORMANCE and is run every 15 minutes:


Declare
test number;
Cursor c_worklist
Is
select *
from v_worklist
where id = v_id;
Begin

FOR rec IN c_worklist LOOP
test := 0; -- does nothing
END LOOP;
end;


A nice little wtf-snippet. The purpose? According to "the vendor" the cursor that loops through every row in a view is supposed to keep the data in Oracle's cache, and if not in place some web service will time out. I believe we have better tools to keep stuff in cache.