Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Function calls count during SQL execution.
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?
SYS:jozh> create or replace function testsleep return number is SYS:jozh> begin dbms_lock.sleep(3); SYS:jozh> return 1; end; SYS:jozh> /
N
1
Elapsed: 00:00:06.15
SYS:jozh> drop index teststabi1;
Index dropped.
SYS:jozh> select * from teststab where n=testsleep;
N
1
Elapsed: 00:00:15.38
SYS:jozh> set timing off
Jurijs
PS
FULL TESTCASE TEXT:
show release
drop table teststab;
create table teststab (n number);
begin for f in 1..5 loop insert into teststab values(f); end loop; commit;
end;
/
create index teststabi1 on teststab (n);
create or replace function testsleep return number is
begin dbms_lock.sleep(3);
return 1; end;
/
set timing on
select * from teststab where n=testsleep;
drop index teststabi1;
select * from teststab where n=testsleep;
set timing off
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Mon Jun 21 2004 - 11:18:48 CDT
![]() |
![]() |