From oracle-l-bounce@freelists.org Wed Jun 23 05:24:00 2004 Return-Path: Received: from air189.startdedicated.com (root@localhost) by orafaq.com (8.11.6/8.11.6) with ESMTP id i5NANjE21295 for ; Wed, 23 Jun 2004 05:23:55 -0500 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id i5NANZ621244 for ; Wed, 23 Jun 2004 05:23:45 -0500 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3F32A72C422; Wed, 23 Jun 2004 05:07:08 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21428-50; Wed, 23 Jun 2004 05:07:08 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 935B172C2E5; Wed, 23 Jun 2004 05:07:07 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 23 Jun 2004 05:05:46 -0500 (EST) X-Original-To: oracle-l@freelists.org Delivered-To: oracle-l@freelists.org Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6629C72C38E for ; Wed, 23 Jun 2004 05:05:45 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20868-65 for ; Wed, 23 Jun 2004 05:05:45 -0500 (EST) Received: from smtp802.mail.ukl.yahoo.com (smtp802.mail.ukl.yahoo.com [217.12.12.139]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with SMTP id 96D9D72C380 for ; Wed, 23 Jun 2004 05:05:44 -0500 (EST) Received: from unknown (HELO Primary) (oracle-l@freelists.org@217.43.211.170 with poptime) by smtp802.mail.ukl.yahoo.com with SMTP; 23 Jun 2004 10:27:16 -0000 Message-ID: <01f901c4590c$aa95a530$7102a8c0@Primary> From: "Jonathan Lewis" To: References: Subject: Re: Function calls count during SQL execution. Date: Wed, 23 Jun 2004 11:27:20 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at freelists.org X-archive-position: 3399 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: jonathan@jlcomp.demon.co.uk Precedence: normal Reply-To: oracle-l@freelists.org X-list: oracle-l X-Virus-Scanned: by amavisd-new at freelists.org 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 ----- Original Message ----- From: To: Sent: Monday, June 21, 2004 5:14 PM Subject: 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? ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request@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 -----------------------------------------------------------------