Poor Performance of Select in Explicit Cursor
However, if I execute the SELECT statement directly (i.e. not within the cursor), the indexes are used, and performance significantly improved.
The cursor is declared within a package :
CURSOR bearer_pvc(bearerid IN VARCHAR2)
RETURN pvcsum_rec
is (
select .......
);
and I call it from my test harness using an OPEN, LOOP, FETCH, END LOOP, CLOSE sequence. Using the 'sql_trace' and 'timed_statistics' session settings I can find an execution plan in a trace file, as follows :