Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Function calls count during SQL execution.
In the case of the index, Oracle generates a startkey and a stop key (even for a unique index scan) so has to call the function twice.
In theory, you could declare the function to be deterministic to avoid the multiple calls - but that doesn't seem to work.
One work-around is this:
select * from teststab where n=(
select /*+ no_merge */ testsleep from dual
)
/
Regards
Jonathan Lewis
http://www.jlcomp.demon.co.uk/faq/ind_faq.html The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/seminar.html Optimising Oracle Seminar - schedule updated May 1st
Hello any one,
How many times Oracle executes user function during SQL execution, I
wonder (if there any related docs. or papers please point me)?
Take a look on TESTCASE below. It is strange to me, that Oracle with index
on mthe column execute function 2 times, but without for each row. Why it
so?
Is there any method to tell Oracle to execute user function (testsleep)
ones?
![]() |
![]() |