Best way of using two or more functions - about speed?

Hello.
I would like to know what is faster.
1. If you have one function and in that function you call another function, like
fun1 is
begin
input := fun2(old_input);
return input;
end;
Call:
select fun1(input) from dual;
2. Or if you have two separate functions and call them like
select fun1(fun2(input)) from dual;
Thanks
Message was edited by:
DejanH

Not so scientific observation. But my func2 seems to be taking more time.
SQL> create or replace function func1
  2  return date is
  3  v_date date;
  4  begin
  5     select sysdate
  6     into v_date
  7     from dual;
  8 
  9     return v_date;
10  end;
11  /
Function created.
Elapsed: 00:00:00.02
SQL>
SQL>
SQL> create or replace function func2
  2  return date is
  3  v_date date;
  4  begin
  5     select func1
  6     into v_date
  7     from dual;
  8 
  9     return v_date;
10  end;
11  /
Function created.
Elapsed: 00:00:00.02
SQL>
SQL>
SQL> create or replace function func3
  2  return date is
  3  v_date date;
  4  begin
  5     v_date := func1;
  6  --
  7     return v_date;
  8  end;
  9  /
Function created.
Elapsed: 00:00:00.02
SQL>
SQL> create or replace function func4
  2  return date is
  3  begin
  4     return func1;
  5  end;
  6  /
Function created.
Elapsed: 00:00:00.01
SQL>
SQL> declare
  2     var_date date;
  3  begin
  4     for i in 1..10000 loop
  5        select func2
  6        into var_date
  7        from dual;
  8     end loop;
  9  end;
10  /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.07
SQL>
SQL>
SQL>
SQL> declare
  2     var_date date;
  3  begin
  4     for i in 1..10000 loop
  5        select func3
  6        into var_date
  7        from dual;
  8     end loop;
  9  end;
10  /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.02
SQL>
SQL>
SQL> declare
  2     var_date date;
  3  begin
  4     for i in 1..10000 loop
  5        select func4
  6        into var_date
  7        from dual;
  8     end loop;
  9  end;
10  /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.02
SQL>
SQL>
SQL>
SQL> Cheers
Sarma.

Similar Messages

  • What is the best way off using two external harddrives with timemachine?

    Hi,
    I have already searched the board but I am still not sure what the best way is to backup to two harddisk.
    Here is what I want to achieve:
    I have two identical external firewire drives. One is always stored at my parents house. I swap drives once a week +(not perfect, should be everyday but much better than nothing).+
    Before TimeMachine I have used SuperDuper which made incremental backups on both disks.
    Due to my "method" I never have both drives at home. So it will not work to clone the external disks.
    Can I now simply swap the drives and TimeMachine will backup again on disk 2, what it has already backupped to disk 1? Like "catching up" the now missing backups for the last week?
    Should I give the disks the same names or should I choose "change disk" everytime?
    I appreciate any suggestions and experiences.
    Best Regards
    Olaf

    Hi Olaf,
    Germany . . . hmmm, nice talking to you!
    OK - We seem to have a lot in common. I used SuperDuper all the time too. Loved it. NEVER had a problem at all with it. Ever!
    I use Carbon Copy Cloner now - it seems a bit erratic - sometimes fails, sometimes works, can't find the pattern.
    But enough of that.
    YES - Time Machine will do exactly what you want (or does for me, at least.)
    I named the two drives the same name and bounced back and forth between them, Time Machining to each. Works PERFECTLY every time . . . BUT - you MUST go to TM preferences each time and click "change disk". Simply reclick the one it sees. This seems stupid - but it's worked every time for me so far. So this morning, I simple renamed one of the backup drives (from Finder). Simple renamed it.
    Went directly to TM with the renamed disk - clicked "change disk" - he instantly "saw" the newly named disk - and it Time Machined perfectly to the "newly named" one. I didn't even have to re time machine the entire drive - it picked up perfectly and backed up only 50 meg, which is all I changed!
    So Time Machine seems to work perfectly backing up to two hard drives, with either the same name, or different names - TM doesn't care. But you MUST simple click "change disk" each time.
    Let me know how it works for you. It really does work for me!
    Larry

  • What is the best way to use two external displays at the same time?

    One of my displays has HDMI, DVI, and VGA inputs. The other has VGA and DVI inputs.
    MBP, early 2011
    Mac OS X 10.6.7
    2.4 GHz Intel Core i5

    Kappy is dead on correct about Bridge Mode as a requirement for the Time Capsule.
    Do you know how to check to see if the Time Capsule is configured this way?
    Next question.....you really should not try to have two wireless networks....one Arris and another Time Capsule.....unless it is absolutely necessary. Two wireless routers in close proximity can create wireless interference effects that can cause problems with either...or both...networks.
    Best to turn off the wireless on one router to keep the chances of wireless interference between routers minimized.
    Are both the Arris and Time Capsule providing wireless signals?

  • Best way to use an external drive

    Hello all,
    I have several photos.
    I also have three computers that I regularly use: my Windows PC, my Macbook Pro, and a very new iMac.
    Rather than place all my photos on each computer... I thought I could place them on a Western Digital Passport portable ext. drive. Then somehow use the drive from computer to computer to edit/play with my photos.
    How do I best use iPhoto 08 to do that? I'm not sure... do the photos have to be on the computer in order to make albums, libraries, folders, etc? Or are those things more of thumbnails that POINT to certain files?
    Please help a newbie understand the best way to use his external drive.
    Thanks for any and all help!

    Hello, and welcome, Theodore!
    I must first say that I don't yet have iPhoto 8.
    I do, however, have a lot of experience with external drives (I have two). I have a huge amount of music in iTunes, so I keep a copy of it on each external drive. Then, when I need to access my music , I turn on either external drive, up comes the External Drive symbol on my display, then I go over to my dock, and select iTunes. I must remember to first open up the External Drive BEFORE I open iTunes (or iPhoto). I then add or subtract music (or photos), edit, and work on my collection. When I'm finished, I just close the application, then select the Hard Drive symbol, and choose File/ Exit Hard Drive. Reach over and turn off my Hard Drive, and it's all good. I just always remember to open the Hard Drive FIRST, before opening the application.
    The same would work for iPhoto. If you place iPhoto onto your external drive, you could probably use any of your computers to connect to it. I would suggest you think about backing up your external drive's contents with either another external drive (which was my choice), or other alternate storage methods.
    I only have one PowerBook, not multiple computers, but, other than that, the situation's the same. You want to keep your iPhoto collection off your computers, and onto one external drive. I hope this information can be of some help to you.
    All best wishes... Cea

  • Does Adobe Reader for iOS have the ability to open inbedded links to additional PDF docs?  If not, then what would be the best way to use these already created PDF's?

    Does Adobe Reader for iOS have the ability to open inbedded links created with Acrobat Standard to additional PDF docs?  If not, then what would be the best way to use these already created PDF's on an I Pad?

    driddy61,
    As of June 2014, none of the Adobe Reader mobile products support the hyperlink action for opening a separate PDF document.
    Adobe Reader for iOS
    Adobe Reader for Android
    Adobe Reader Touch for Windows 8
    In addition, the Reader mobile products do not open multiple windows/documents simultaneously, which would make the navigation between PDF documents nearly impossible. (Once a hyperlink takes you to a different PDF document, you have no way to go back to the original PDF document.)
    The only Adobe Reader product that fulfills your department's requirements is Adobe Reader XI (mostly for Windows/Mac desktop/laptop computers).  Acrobat Pro and Standard are paid products.
    Because you are in search of a less expensive device for your department, you could get a Windows tablet instead of a Windows desktop/laptop computer. Microsoft Surface Pro (that you've mentioned in your previous reply) is just one example.  You can also find other less expensive Windows tablets.
    Tablets
    However, please keep in mind that there are two different types of Windows tablets running two different operating systems.
    (a) A Windows tablet with an Intel-based processor running Windows 8.1 Pro
    Example: Surface Pro 3
    You can install and run traditional desktop apps (e.g. Adobe Reader XI) and new Windows Store apps ("Modern" or "Metro-style" apps).
    (b) A Windows tablet with an ARM-based processor running Windows RT 8.1
    Example: Surface 2
    You can only install and run Windows Store apps (e.g. Adobe Reader Touch) but not traditional desktop apps like Adobe Reader XI.
    In general, type (b) tablets are more affordable than type (a) tablets.  However, if you want to run Adobe Reader XI, you do need to check the technical specification of each tablet and make sure the following conditions are met.
    Processor: Intel
    Operating system:  Windows 8/8.1 or Windows 8/8.1 Pro, not RT
    Hope this helps you choose the right device for your department.  Please let us know if you have any questions about system requirements or supported features in the Adobe Reader products.

  • What's is the best way to use iPhoto? I need to understand.

    What's is the best way to use iPhoto? I need to understand.
    I guess the iPhoto is only for people with 5,000 of personal photos.
    Or even 200,000, but they can't use this app everyday.
    I'm not talk about working as a photographer. They use Aperture.
    They may use iPhoto like a family album that you take a look sometimes.
    And don't care about putting photos from the camera or from internet everyday.
    I have tons of music and I love iTunes 8, works great. So I tried but I can't stand iPhoto anymore.
    I have over 173,000 photos. My goal is organize, have total control, crop in Preview and delete them fast as I can.
    The iPhoto is too slow. And is not only about performance, more RAM... but the whole concept.
    Finder is much better/richer/flexible to organize than iPhoto.
    I'm not talking about the photographer workflow.
    And I'm not talking about editing and all these great photo features, the search, and all the iLife environment. They are amazing.
    When I'm iPhoto, I feel like a prisioner.
    I can't open an album/folder/event alone just to take a look, without do lanch the iPhoto app with the all thousand photos together. And it's slow.
    I can't use Quick Look there.
    So, I'll use Finder for manage/crop/etc. But what's the best way to use iPhoto in my case? Put the best/key ones there to use in iLife/MobileMe? To do a more serious editing? I like the features: keywords/ratings/hidden photos/events... It would be cool this features in Finder.
    For example:
    iMovie: Manage movies? NO. It's editng only.
    iTunes: Manage music/small video/podcast...? OK. Editing the song? OK for tags/convert/artwork/equalizer... For music there's a GarageBand of course.
    iPhoto: Manage photos? Yes and No.
    I think Finder would kill iPhoto incoporating all the editing features in Preview and the rich manage in Finder.
    Jobs said that no one care about iDVD anymore. They care about the web.
    Using iMovie to export to MobileMe.
    Maybe iPhoto become less important in a near future. With a better Finder+Preview Right?
    Sorry for this long text with a short question.
    Thanks.

    Your post demonstrates exactly why I keep saying that iPhoto is not the application for you.
    It would be better an iPhoto organizing photos by words like when iTunes browse his music.
    Why on earth would anyone want to organise photos by words? A list mode is entirely pointless in a Photo application. That's like having an old photo album organised with the photos facing inwards so you can read the back of the picture.
    Again, this is a characteristic of a File browser. You don't want a Photo organiser, you want a file organiser.
    And, in iPhoto, you can search by tags, effortlessly in either the search box or by using a Smart Album.
    iPhoto always loads all that events and all the thumbs library to scroll, and I think it's overkill.
    So, how is iPhoto to know which ones you want to work with today? Open a library, get the Library.
    Would be better a Cover Flow option to browsing in Events.
    You've obviously never tried scrubbing along the Event icon.
    Imagine iTunes using Cover Flow mode all the time. It won't be too useful.
    Many, many people do, including myself on a library of 20k tracks totalling more that 100 gigs, and find it very useful. Same with the Finder.
    And if when iTunes Store starts to sell photos?
    Why on earth would the iTunes store start to sell photos?
    My photos are not junk,
    I didn't say there were. Read my post again.
    When I said Finder to crop photos I mean Preview. But I feel in Finder. Because what's in Preview? A photo opened with a Preview's menubar and some cocoa APIs like adjustments. Not?
    Oh, so you don't count Preview as an application. Fine. It is an application but you don't feel it. As you wish.
    My point to you is very simple: Because of the way you want to organise your pics - using lists views and so on - iPhoto is not the application for you. Don't use it. But you keep writing things about the application that are untrue, and I'm aware that other folks search these forums and I don't want them to have inaccurate information about iPhoto.
    Regards
    TD

  • What is the best way to create a read more/collapse text box on the homepage of a site?

    What is the best way to create a read more/collapse text box on the homepage of a site?

    I figured this out by using a lightbox. I set the trigger at the top of the box, hid all initially and added a close button. In the box that would have linked to the first thumbnail for the lightbox, I added a text box that said "read more"

  • What is the best way to use a cellular enabled iPad in France?

    What is the best way to use a cellular enabled iPad in France?

    Frankly, I expect a bit more courtesy and details from someone wanting help from fellow users.
    Don't use your AT&T SIM/plan out of the country for the iPad.
    Just purchase a SIM in France for about 15 euros and use that.
    -> http://www.tripadvisor.com/ShowTopic-g187070-i12-k4781004-o30-Prepaid_French_3G_ micro_SIM_for_iPad_it_s_not_a_problem-France.html

  • How to create a unique key using two or more attributes?

    how to create a unique key using two or more attributes ?

    The following example illustrate how to create a unique key using two or more attributes/fields
    Scenario: Implementing Unique Key on ManagerID & Location ID in DepartmentEO(Department Table)
    Step#1: Open the Desired Entity Object “DepartmentEO”. Go to Overview tab & Click “General” Finger tab.
    Step#2: Expand “Alternate Keys” section & click “+”.
    Step#3: In the Pop-up wizard, Enter a name for alternate Key “Unique_Manager_X_Location”.
    Step#4: Select the desired attributes/fields from available list & Shuffle to right side.
    Step#5: Now go to “Business Rules” finger tab.
    Step#6: Select “Entity Validators” in the list & click “+” to add a new entity level validation rule.
    Step#7: In the Pop-up, Select “Rule Type” as Unique Key
    Step#8: In the “Rule Definition” tab select the key “Unique_Manager_X_Location”created.
    Step#9: Now go to “Failure Handling” tab, and click the Magnifier Icon .
    Step#10: If the key is not already created then in the “Select Text Resource” Popup, Using the functional design document, Enter display value, Key and Description. And click “Save & Select” Button.
    Step#11: Now Click “OK”.

  • What is the best way to use EJB modules with JAX-WS?

    Hi.
    I am doing a project that returns EAN13 encoded data to external java clients.
    I think I need to use a webservice that send response, a webservice client that send the request, and other project that transforms a data to an EAN encoded data, returns it and store it in MySql database.
    It is possible that I need to authenticate users for every request made.
    -I have created a EJB module contained into Glassfish for the webservice
    -I have created a Common Java project with 3 layers: Entities, bussines and data access layer for mysql database
    -I have a project for the webservice client with JAX-WS ( is the best choice? or Would be better JAX-RPC? )
    **How would you suggest me create the structure of the project with all the java power?*
    **Could you help me with goods tutorial of design patterns about webservices using EJB and the best way for use databases for this kind of projects ( I have heard about JNDI, Hibernate, Session EJB, ... )?*
    **Would be better use other EJB module instead of a Common java project that has classes?*
    h3. {color:#333399}I shall be pleased with your help{color}

    Kappy is dead on correct about Bridge Mode as a requirement for the Time Capsule.
    Do you know how to check to see if the Time Capsule is configured this way?
    Next question.....you really should not try to have two wireless networks....one Arris and another Time Capsule.....unless it is absolutely necessary. Two wireless routers in close proximity can create wireless interference effects that can cause problems with either...or both...networks.
    Best to turn off the wireless on one router to keep the chances of wireless interference between routers minimized.
    Are both the Arris and Time Capsule providing wireless signals?

  • Can I use two or more seperate Apple ID accounts on Apple TV? Everyone in my family has a different account.

    Can I use two or more Apple ID accounts on the new Apple TV? Everyone in my family has a seperate account.

    Of my 7 Apple TV's only one is connected by ethernet, they all work as expected, more often than not at the same time (I probaly haven't had 7 running at the same time, it depends on who's using what))

  • HT3819 I have 2 Ipod touch's, one a 64gb and one an 8gb.  Whats the best way to use them both on the same itunes account?

    I have 2 Ipod touch's, one a 64gb and one an 8gb.  Whats the best way to use them both on the same itunes account?

    Click here for options.
    (64410)

  • The best way to use 2 iphones with 1 Mac

    Can someone explain whats the best way to use 2 iphones on 1 Mac.
    2 different Calendars, 2 different adressbooks, etc., 1 iTunes Library, 1 Photo Library
    But it would be great to see each others Calendars
    Until now one mobileme Account.
    Thanks in advance
    Jan

    I'm hoonesstly not sure about the second mobile me account. My guess would be that you will need another one though. The only way to see her calendar is to log into her user account. Not a problem if you have her password.

  • Is there a way of using a mail merge function while on the iphone or ipad, i wish to email a "Word style, ot TXT" document to 250 of my contacts

    Is there a way of using a mail merge function while on the iphone or ipad, i wish to email a "Word style, ot TXT" document to 250 of my contacts, I have tried downloading my contacts to my PC's outlook but only 1 contact comes across at a time despite the fact that Icloud says downloading namedperson + 249 other contacts to a CSV file

    Hi everyone!
    Looking also for an app that allows me to merge email and send them out to each recipient individually. Apparently that's not possible yet. Here's what the guys at RedbitsApps told me about Group Email capabilities: 
    "The current version of the app relies on the device operating system to send the emails. For this reason, sending individual email instead of a single email to multiple recipients is not possible. Apple doesn't allow apps to send single emails to many recipients easily. We may use a custom sending software in a future version."
    Let's keep looking guys... 

  • What's the best way to use your iPad instead of textbooks?

    What's the best way to use your iPad instead of textbooks? I'm about to start a BSN program and have heard of using your iPad for textbooks instead of buying and carrying around 8 different books. Is there an app for that? Or do you buy or rent the books? What's the best solution?

    Or, if you're like me and you want to do a lot of heavy reading, use the iPad because the low contrast on a Kindle is extremely fatiguing.  
    Seriously, though "screen glare will cause eye strain" is often taken as an article of faith, there's not a lot of good scientific evidence for it. "Eye strain" can be caused by concentrating on any close work for long periods of time. Looking up and focusing on something distant periodically is very helpful. Older CRT screens that flicker also can be aggravting. I'm not denying that some people find reading backlit screens uncomfortable. However, it's not dangerous. And, then, there are other people who find the higher contrast a backlit screen affords to be much less wearying over long periods of time.

Maybe you are looking for

  • DW 4 - can I stop it from opening the objects window by default

    I've used Dreamwaver 4 for years, and have closed the objects windows a few hundred thousand times because it opens by default every time I open an html file. Is there any way to set the default so that the objects window does NOT open automatically.

  • How to delete log files in ACS 3.3

    hi guys, does any 1 know how to delete log/accounting files (*.csv) in ACS 3.3 (software version under win2000 server) kindly let me know, coz i m not able to find any option that allows me to delete them

  • Certificates delay

    Hi, I wrote my SAP HR Certification exam on 08 December 2006 in SA. Up to now SAPSA are saying they have not received the certificates. I have even left the country. How long does it take for SAP to print and send certificates after someone has passe

  • Jdk1.4 help

    Dear Friends I develop one application in which i use servlet/jsp . I develop my application on JBoss-Tomcat and Mysql combination . My application run perfectly on JDK1.3 . Last night i install jdk1.4 and Start my jboss server . i got following erro

  • IPod and Volvos

    Some time ago I purchased an iPod adapter for my Volvo (2006 xc70). This is a relatively expensive (i.e. more than the iPod itself) cable assembly that connects the iPod to the car stereo system. It works with some limitations and I am happy with it.