Re: ouch

  • From: David Fitzjarrell <oratune@xxxxxxxxx>
  • To: "njonkers@xxxxxxxxx" <njonkers@xxxxxxxxx>, Oracle L <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 31 Aug 2011 14:33:53 -0700 (PDT)

I did just that and posted to the list; the "time-saving" function performed 21 
more recursive statements than the native function.  Wasteful in my book.


David Fitzjarrell


From: Neil Jonkers <njonkers@xxxxxxxxx>
To: Oracle L <oracle-l@xxxxxxxxxxxxx>
Sent: Wednesday, August 31, 2011 2:13 PM
Subject: Re: ouch

Hi Stephan

One approach would be to illustrate via autotrace.
Reading from DUAL results in a Full Table Scan if the database version is prior 
to  10 g.


Regards
Neil

>>> "Uzzell, Stephan" <SUzzell@xxxxxxxxxx> 08/31/11 10:31 PM >>>
Found a gem in one of my databases today:

FUNCTION                        "SUBSTRING"
(INSTRING IN varchar2,
STARTPOS IN number,
LENGTH  IN number)
RETURN varchar2
IS
  RESULT varchar2(8000);
BEGIN
select substr(INSTRING, STARTPOS, LENGTH)
into RESULT
from DUAL;
RETURN(RESULT);
END;

I'm offended by the sheer aesthetics of this. And I want to go yell at the 
developers that this is wrong. But I'd need a better argument than that it 
offends me. Is there some way to quantify the impact (if any) of wrapping a 
built-in function like this?

Stephan Uzzell



All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/emaildisclaimer

--
//www.freelists.org/webpage/oracle-l
  • References:

Other related posts: