Performance... Why a function column in a view is executed more than once...?

Why a function column created inside a view is executed more than once when called more than once?
EXAMPLE:
create or replace view aux1 as
date_column,
any_function(date_column) column1
from any_table
create or replace view aux2 as
column1 c1,
column1 c2,
column1 c3
from aux1
select * from aux2
It will execute 3 times the function any_function... logically the value will be the same for all columns...
I understand why!... are 3 calls... but...
Why not to create a "small" verification and if the function column was execute replace the second, the third... value? ... instead of execute 3, 4... times...
tks
Braga

Actually, this is more than a performance issue. This is a consistency problem. If the function is NOT deterministic then you may get different values for each call which is clearly not consistent with selecting 3 copies of the same column from a row. Oracle appears to have fixed this in 9i...
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
With the Partitioning option
JServer Release 8.1.7.2.0 - Production
create view v1 as select dbms_random.value(1,100) r from dual;
create view v2 as select r r1, r r2 from v1;
select * from v2;
          R1           R2
          93           74
Connected to:
Oracle9i Enterprise Edition Release 9.0.1.3.0 - Production
With the Partitioning option
JServer Release 9.0.1.3.0 - Production
create view v1 as select dbms_random.value(1,100) r from dual;
create view v2 as select r r1, r r2 from v1;
select * from v2;
          R1           R2
          78           78Richard

Similar Messages

  • Can the same partner function be entered in the sales order more than once.

    Hi
    I know that as per standard same partner function cannot be entered more than once in Sales order.
    If somebody has tried ways to do this please share.
    THanks
    Alags

    Yes. You can have multiple Ship to Party, Bill to Parrty & Payer in Sales Order. But Sold to Party will have to Unique & single.
    This functionality of having multilpe Partners is widely used & just follow as Deepak suggested above & you too can have multiple Partners of same type in single Sales Order.
    But there has to be a strong Business case in doing so... say different Ship tp Party for different line items in Sales Order or different BIll to Party for some line Items in Sales Order.
    Hope this helps,
    Thanks,
    JIgnesh Mehta

  • Function module In Update Task is called more than once

    Hi experts!!
    I had a requirement to Create a Customer ( i will call it B) when another Customer (A)  is created (ON SAVE).
    I used a Badi to implement the requirement, and inside my Badi i have 2 Function Calls in Update Task.
    The first one to create Customer B and the second one to send Customer's B data to another System.
    Even though the second function call is inside an IF-ENDIF condition ( so that only Customer's B data are sent) the function is called twice sending the same data. My guess is that since the First Function saves the Customer to the database, that is the reason why the second Function is called twice.
    Is there any way i can control how many times a Function In Update Task is called????
    Please help!!
    Thank you in advance!!

    Hi BreakPoint & thank you for your reply!!
    I tried your suggestion but even if i fill the flag during the first call the function is called twice. Looks like during the second database commit the function is called with the correct conditions met but twice.
    Also while debugging it looks like it is only called once. It s very strange!
    Any other ideas???

  • Why do the same permissions have to be corrected more than once

    Each time I check permissions, it seems as if the same errors need to be fixed. Why do the same errors keep on repeating themselves?

    Michael,
    I hope that is all that is, and I suspect you are right. A bug would cause the same errors to pop up each time. I get errors such as user differs, should be 0, user is 95., etc., which is accord with what you suggest. Almost all of the errors I get are Java VM Framework related, and I am aware of how problematic that could be.
    In any case, thank you for your insight.
    Sara

  • Why is the print area on all envelope templates more than 1/2 an inch from the left side of the envelope.. ? Can this be fixed or changed.. ?

    Why is the print area on all envelope templates more than 1/2 inch from the left side of the envelope.. ? Can this be fixed or changed.. ?
    I have pages 09 version 4.1... It is a small aggravation.. The left 3 or 4 characters on the return address would not print until I realized that by clicking on
    " View " & " Show Lay-Out " that it was out side the printable range ...

    It seems to be a Pages template  " Print range " issue..  Both the Epson and the HP printers were doing it and it was today that I realized why..  !!
    When I move it to where it will print there is large gap on the left margin of the return address..  Just wondering if anyone else knew about this.. ? My Pages is ' 09 ' version 4.1...

  • Why would aperture load more than once?

    I understand that when I first load my RAW photos into Aperture it needs to generate a preview and so that's why it slows down and shows me "loading...". If I want to bypass this I can use quick preview mode. That's how I understood it so far. But I don't understand why it would need to load again at a later time? If I browse elsewhere and come back to this project, it'll start loading again. Does Aperture for some reason deletes the preview?

    1) How do I force aperture to generate preview for everything, and not one by one. I'd rather go away and let the computer do its thing for a while than get disturbed every time I hop to the next photo.
    You can select all images in the Browser and use the command "Photos > Update/Generate Previews" (Update will turn into "Generate", if hold down the ⌥ alt/options key). This way you can generate the previews over night.
    2) Also this still doesn't explain why it needs to be done more than once? Why would it generate the preview again if I haven't changed any adjustments etc?
    It will only keep and store the preview permanently, if you have enabled the sharing of previews in the "Preferences > Preview" tab. If you do not enable this, Aperture will not store the previews, to save space.

  • Why would you need to "zero out" more than once?

    Sorry if this is a dumb question, but I have always wondered why a hard drive would need to be written over more than once for better security?
    If it is writing ALL zeros what is there left to find? I just don't get it.
    Thanks,
    Curious Tom

    Hello! A random write could leave a few bits that might be salvadged while the "zero all data" maps out bad blocks and writes all zeros. Once should be enough. Tom

  • Why do i have to pay more than once for my purchased album in itunes, when i download them again?

    why do i have to pay more than once for my purchased album in itunes, when i download them again?

    Probably because you purchased them again, instead of following the proper method for redownloading apps.
    Downloading past purchases from the App Store ... - Support - Apple

  • Why do holidays appear more than once?

    Why do holidays appear more than once?

    I have the new iPad and iPhone 5
    both run on ios 6
    I have multiple holiday calendars on both devices
    Step 1: delete your gmail account and calendars go away
    Step 2: DELETE your icloud account under setting on iphone and select also delete on iphone
    Step 3: add Gmail and Calendar by following directions below (you will NOT get multiple google calendars)
    Step 4: go back under setting and sign up for icloud again and turn everythin you want on, ON, even Calendar
    You are done, no multiple calendars
    **I struggled for a week with this issue and researched online and tried other methods such as unchecking default Birthday icloud calendar, hard reset, uncheck holidays in Gmail, on iphone, none of it worked.....what worked were Steps 1-4 above!!!!)
    My iphone 5 is perfect now..no 20 of the same holidays in one day!!!
    By the way if you want multiple Google calendars to show up do it this way:
    First of you are a gmail user, do NOT use the default gmail sync option if you want ALL of your calendars from Google to show up, multiple colors etc); use MS Exchange, server address is m.google.com
    Then go to m.google.com/sync to sync your iphone calendar ON YOUR IPHONE BROSWER, you check mark the calendars you want
    Presto, your Google calendars -- all of them -- show up

  • Execute more than 1 function from process code IDOC

    Hello,
    Is it possible to execute more than 1 function via process code of an IDOC?
    I am talking about inbound IDOC.
    Sara

    Hi Sara,
    What is the exact requirement.
    Regards,
    Madhu.

  • Maintenace view for fld more than 500 characters

    Ho do i create a maintenance view for fld more than 500 characters? i  need a maintenance view to maintain URL which is sometimes more than 500 chars.

    The way SAP solves this for webservices is via a hash.
    Once you have executed the service, the URL populates a mapping table and generates a unique hash value for it.
    Via this hash, you can assign it to authorization fields and use it in your coding where the fields have limitations.
    As a consequence this causes some confusion if you dont use F4, but it does work.
    Cheers,
    Julius

  • Oracle.jbo.JboException: JBO-34010: The "adf/tabs/view/DataBindings.cpx" descriptor appears in the application classpath more than once:

    Hello
    We are using JDeveloper 11.1.1.6
    We have three 3 separate viewcontroller projects and one Master projects which i supposed to integrate all these projects into one.
    Issue:
    After putting all three together into the Master project, the app fails to deploy due to this error:
    oracle.jbo.JboException: JBO-34010: The "adf/tabs/view/DataBindings.cpx" descriptor appears in the application classpath more than once:
    We did some digging and found out that it is because of the fact that "DataBindings.cpx" in all three projects falls withing the default package. How do we rectify this issue. We cannot even Refector this file because that option is not available for this file. We have a demo soon, What can we do?
    Thanks...

    Hi,
    this error typically comes from name clashes. Apparently you created ADF libraries (or projects) that contain a DataBindings.cpx file. The DataBindings.cpx file seems to be located in the same folder structure and thus could not be merged but are found to be added twice. When you create new view controller projects then best practice is to ensure the root package name is unique to avoid such issues.
    Frank

  • One button click call function more than once

    I have a function I call from a button (onClick) which
    inserts a record in mySQL via a PHP page. For some odd reason it
    tends to insert more than 1 record. The extra records tend to be
    duplicates of previous records. I do not know of SPRY is calling
    the function multiple times, if stuff is cached somewhere and it
    calls the cached data and the new data. I perform record INSERTS
    and UPDATES on many web pages via PHP which get called thousands of
    times but only this SPRY application is doing this. Please see my
    code below.
    Spry.Utils.loadURL function: (not that I want to use POST but
    having an issue and so using GET)
    function addcommentget(recordID)
    var newcomment = document.form1.tescomment.value
    Spry.Utils.loadURL("GET","addTEScomment.php?id="+recordID+"&comment="+newcomment,true,Upda teRecordCallback);
    FORM code (where button and textarea are)
    <form action="" method="post" name="form1">
    Add Comment: </br>
    <textarea name="tescomment" cols="40"
    rows="2"></textarea></br>
    <input name="addcomment" type="button" value="Submit
    Comment" onClick="addcomment('{@id}');">
    </form>
    PHP code:
    <?php session_start();
    require_once('Connections/ppg_conn.php');
    $id = $_GET['id'];
    $comment = $_GET['comment'];
    $user = $_SESSION['username'];
    $sql = mysql_query("INSERT INTO
    claimsmanager_tesedits_comments (Ticket_ID, Commenter_email,
    Comment)
    VALUES('$id', '$user', '$comment')
    ") or die (mysql_error());
    ?>
    Is there anything you see that might cause this strange
    behavior?
    Thanks,
    Lee

    Spry.Utils.loadURL() only fires off a single request when you
    call it.
    Aside from the fact that your button calls "addcomment" as
    opposed to the "addcommentget" function you show ;-), I don't see
    any problem. Of course I'm not seeing the big picture, only what
    you post. Do your data sets load URLs that actually perform DB
    updates? Or are they pure DB query URLS?
    I would put a line like this:
    Spry.Debug.trace("AddCommentGet() triggered!");
    in your addcommentget() function and see if you get a single
    trace statement every time you press the button.
    --== Kin ==--

  • Not able to view data from more than one data package in PSA

    Hi Friends,
    Desparetly trying to view data in PSA. Problem :
    If i mark more than one datapackage this error raises:
    You must only select one data packet when entering data record numbers
    Message no. RSAODS127
    And there is no change to reset data record numbers.
    What is wrong ?
    Thanks in advance for help.
    Joe
    BW3.5, SP21
    Edited by: J.F.B. on Jul 2, 2009 11:40 AM

    Hi again,
    Seems I'm too stupid for this issue.......
    As I understand there are two ways to view PSA :
    1. PSA maintenance in RSA1
    2. In SE11/SE16 viewing the underlaying transparent table
    ad 1.
    When I try to filter erroneous records for more than one datapackage situation is as described above.
    ad 2.
    Trying to view the table works, but where is the chararcteristic/field marking a  record as erroneous
    in table /BIC/Bxxxxxxxx (table containing PSA-Data) ?
    Thanks
    Joe

  • Why are some properties collections, can they really contain more than 1 item?

    I notice that sometimes an objecthas a property that I would expect to be singular, but is exposed as a collection. For instance, TextFrame.texts is a collection of Text objects. But how could a textFrame contain more than one Text object?
    And related to this topic, why does the Text object have a property Texts? What could be in that for a given text?
    Thanks!

    toyo8696 wrote:
    1.This morning upon bootup from complete shutdown, I had like 3 or 4 windows open up.
    Auto resume feature of Lion. To disable the feature:
    Launch System Preferences and click on the “General” icon
    At the bottom of the “Number of recent items” list, uncheck the checkbox next to “Restore windows when quitting and re-opening apps”
    2. Likely tied to above. How can I close, shut down completely programs? I hit the red X then it still shows the white dot under the application in the dock. For example, I use Chrome. I only opened up Safari a few times when I 1st got this yesterday. However, I have a white dot under Safari.
    after you close out the program, when you see the light still under the programs icon in the dock, right click and select quit.
    3. Is there anyway to add a application from the dock to stick in Launchpad?
    not that I am aware of.  This doesn't mean it's not possible.  It just means if there is a way, I am not familiar with how to accomplish this.

Maybe you are looking for