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: Using User Defined functions or not

Re: Using User Defined functions or not

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Tue, 19 Feb 2002 14:47:06 -0800
Message-ID: <F001.00413A77.20020219144706@fatcity.com>


Harvinder Singh wrote:
>
> Hi,
>
> This question is with reference to tuning.....Developers are repeatdely
> using same code ( for example if they want to add as second to date ther
> are using like date+1/86400) and they want to use something like following
> function so that they can write addsecond(date) in their code...
>
> function AddSecond(RefDate date) return date
> as
> begin
> return RefDate + 1/86400;
> end;
>
> Issus is now of performance.......it looks like using function is degrading
> the performance ......Does it advisable to use extensive use of UDF in
> code????
>
> Thanks
> --Harvinder

Harvinder,

    Functions are used for relatively complicated code. You could say 'well, we use a lot of loops, so why not using function inc(i) which returns i + 1'. Calling a function means stacking up a few things (return address, parameters), jumping to an address (which may be outside of physical memory at this time), popping things out of the stack, processing, jumping back ... Complicated stuff. Must be worth the trouble.
 Do not believe that by making everything a function it will become more maintainable. It's very difficult to follow the logic of a program when every two instructions you have a function call.

-- 
Regards,

Stephane Faroult
Oriole Ltd
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Feb 19 2002 - 16:47:06 CST

Original text of this message

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