Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Function calls count during SQL execution.

Re: Function calls count during SQL execution.

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 23 Jun 2004 11:27:20 +0100
Message-ID: <01f901c4590c$aa95a530$7102a8c0@Primary>

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

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?



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

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 Wed Jun 23 2004 - 05:24:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US