What is the benifit of Pipe function

Hi,
I agree that piping function return some set of rows when it is ready.
But if my main query where clause is using the piping function for filter like below
select p_name a1, p_add a2 from tname, tadd where tname.id = tadd.id and tname in (select * from table(pipe_fun_return_some_names));
Now my question is "using pipe function will my main query starts executing without waiting all data return by pipe function"
If yes then how my main query gets executed.
If No how can then will it cost me performance point of view.
so shell using piping function like this improve performance of my sql.
or simply can i use a table type and object to query ---
select p_name a1, p_add a2 from tname, tadd where tname.id = tadd.id and tname in (select * from table(table_fun_return_some_names));
Thanks Gurus...

Ora_Is_Not_Magic wrote:
Hi,
I agree that piping function return some set of rows when it is ready.
But if my main query where clause is using the piping function for filter like below
select p_name a1, p_add a2 from tname, tadd where tname.id = tadd.id and tname in (select * from table(pipe_fun_return_some_names));
Now my question is "using pipe function will my main query starts executing without waiting all data return by pipe function"
If yes then how my main query gets executed.
If No how can then will it cost me performance point of view.Do you mean something along the lines that, if the value is found in the subquery (pipeline function) results early on it will return the main query data quicker than if the value is found later on in the subquery (pipeline function) results?
SQL> create or replace type t_nums as table of number;
  2  /
Type created.
SQL> ed
Wrote file afiedt.buf
  1  create or replace function f_pipe_asc return t_nums pipelined as
  2  begin
  3    for i in 1..1000000
  4    loop
  5      pipe row(i);
  6    end loop;
  7    return;
  8* end;
SQL> /
Function created.
SQL> ed
Wrote file afiedt.buf
  1  create or replace function f_pipe_desc return t_nums pipelined as
  2  begin
  3    for i in 1..1000000
  4    loop
  5      pipe row(1000001-i);
  6    end loop;
  7    return;
  8* end;
SQL> /
Function created.
SQL> @c:\statson
SQL> select 1 from dual where 1 in (select * from table(f_pipe_asc()));
         1
         1
Elapsed: 00:00:00.29
Execution Plan
Plan hash value: 4199234228
| Id  | Operation                            | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                     |            |    82 |       |    28   (8)| 00:00:01 |
|   1 |  NESTED LOOPS                        |            |    82 |       |    28   (8)| 00:00:01 |
|   2 |   FAST DUAL                          |            |     1 |       |     2   (0)| 00:00:01 |
|   3 |   VIEW                               | VW_NSO_1   |    82 |       |    26   (8)| 00:00:01 |
|   4 |    SORT UNIQUE                       |            |    82 |   164 |    26   (8)| 00:00:01 |
|*  5 |     COLLECTION ITERATOR PICKLER FETCH| F_PIPE_ASC |       |       |            |          |
Predicate Information (identified by operation id):
   5 - filter(VALUE(KOKBF$)=1)
Statistics
        100  recursive calls
          0  db block gets
         88  consistent gets
          0  physical reads
        116  redo size
        404  bytes sent via SQL*Net to client
        396  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL> select 1 from dual where 1 in (select * from table(f_pipe_desc()));
         1
         1
Elapsed: 00:00:00.31
Execution Plan
Plan hash value: 2978834354
| Id  | Operation                            | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                     |             |    82 |       |    28   (8)| 00:00:01 |
|   1 |  NESTED LOOPS                        |             |    82 |       |    28   (8)| 00:00:01 |
|   2 |   FAST DUAL                          |             |     1 |       |     2   (0)| 00:00:01 |
|   3 |   VIEW                               | VW_NSO_1    |    82 |       |    26   (8)| 00:00:01 |
|   4 |    SORT UNIQUE                       |             |    82 |   164 |    26   (8)| 00:00:01 |
|*  5 |     COLLECTION ITERATOR PICKLER FETCH| F_PIPE_DESC |       |       |            |          |
Predicate Information (identified by operation id):
   5 - filter(VALUE(KOKBF$)=1)
Statistics
         28  recursive calls
          0  db block gets
         48  consistent gets
          0  physical reads
          0  redo size
        404  bytes sent via SQL*Net to client
        396  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL>I don't have your data to test, but I'm guessing the fact the optimiser is doing a SORT UNIQUE on the pipeline results in order to perform the "IN", it's going to take the same amount of time whether the required value is the first out of the pipeline results or the last.

Similar Messages

  • What are  the input parameters for Function Module

    Dear Experts,
    I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources.
    For that i want to write a Generic Datasource with Function Module.
    audat
    bukrs
    vkorg
    vtweg
    spart
    aurat
    auart
    netwr
    mwsbp
    kschl zedp(consition type)
    kschl zvat(condition type)
    ksch   zcst(condition type)
    matkl     material group
    Here what are the Input parameters for Function Module.
    Thanks in Advance.
    Srinivasan.

    Srinivasan-
    For creating a Generic extractor based on a FM, you first of all need to know what is going to be your structure.. i.e. what all fields you need to pull from what all tables. A functional consultant may help you identify the exact DB tables.
    Once you know them, hand over the requirement and the pdf mentioned by Krishna to the ABAP guy, he would be able to take this up further.
    Also decide 1st whether you would be using a full load or delta. There is a slight difference in the way they are built.
    Let me know how it goes.
    -Bhushan.

  • What is the difference between partner function and partner type

    Hi Gurus,
    What is the difference between partner function and partner type?
    Thanks,
    Paul

    Hi John,
    The partner types allow us to distinguish between different business partners such as customer, vendor, employee etc and the partner functions represent the functionality or role each partner plays within the business transaction.
    For example under the partner type Customer, you will find - Sold to party, Ship to party, Bill to party, Payer.
    The business partners that exist in the market place are represented with a partner type in the R/3 system. Examples of business partners are customer, vendor, employee and contact person.
    The following partner types are defined in the partner processing for the sales & distribution module –
    a.     AP – contact person (06)
    b.     KU – customer (07)
    c.     LI – vendor (08)
    d.     PE – employee/personnel (09)
    Assigning the partner functions in the SAP system determines the functions of particular partner in the sales process. One partner may take on several functions also.
    REWARD POINTS IF HELPFUL
    Regards
    Sai

  • What is ESOA? What is the Scope/Role for Functional Consultants in eSOA.

    Hi Experts,
    1)     Does eSOA is a tool, application or module?
    2)     What is the relation between eSOA and ECC6.0?
    3)     What is the Scope/Role for Functional Consultants in eSOA?
    4)     What I have to learn in eSOA?
    5)     How it is useful for Functional Consultant?
    6)     How it is useful for Customers?
    7)     How much time it will take to learn eSOA?
    8)     Where can get the Material?
    9)     What all technologies I have to learn before I learn  to eSOA?
    I am working as a SAP HR Consultant. If I want to learn eSOA what are the pre-requisites.
    I donu2019t know anything eSOA.
    Please give me the answers.
    Regards,
    Ram

    Hi Ram,
    See the answers below
    > 1)     Does eSOA is a tool, application or module?
    ESOA is not any tool,application or module. Its a methodology/Architecture
    > 2)     What is the relation between eSOA and ECC6.0?
    ECC 6.0 provides some Enterprises Services through enhancement packages.
    > 3)     What is the Scope/Role for Functional Consultants in eSOA?
    FUnctional consultant should know which ENterprise Serrvices are available and which should be developed to carry out a business process.
    > 4)     What I have to learn in eSOA?
    .         Being a technical guy, there are things to be learnt like ESR, implementing designed serivces through ABAP or Java and consuming it. But being a functional guy, only awareness of what enterprise services are available and what they do and their input/output params and how they can fit into a business process is sufficient.
    > 5)     How it is useful for Functional Consultant?
    see above
    > 6)     How it is useful for Customers?
    Customers can move towards Service Oriented Architecture, get flexibility in changing a business process easily, maintaince cost is less
    > 7)     How much time it will take to learn eSOA?
    depends on your skills
    > 8)     Where can get the Material?
    lot of material in SDN
    > 9)     What all technologies I have to learn before I learn  to eSOA?
    ABAP or JAVA,ESR ( being a technical consultant) , Web Services
    > I am working as a SAP HR Consultant. If I want to learn eSOA what are the pre-requisites.
    you should aware of basics of service oriented architecture
    If you further want to clear doubts, do write up.
    Regards,
    Piyush

  • What is the Diff bet partner functions and business partner?

    Hi friends
    what is the Diff bet partner functions and business partner
    Regards
    Abirath

    Hi,
    In SRM there are different Partner functions like REQUESTER, GOODS RECIPIENT, VENDOR ,LOCATION.
    All the org units or users in SRM will have a unique identification number called Business Partner Number maintained in table BUT000.
    The users can have differnt partner functions in differnt documents and accordingly mainatained in table CRMD_PARTNER.
    Hope this will give you some infomation.
    Regards,
    Sheetal.

  • What is the purpose of queue functions?

    well what is the relation of queue functions of Labview
    and queuing theory, like MM1 system MD1 system etc.
    thanks

    Others may have a better explanation and example, but I have found that queues in LabView are very useful when you need to transfer a lot of information quickly and want to make sure you don't overflow or drop elements. They are better at this than using variables because the writer can keep writing whether or not the reader has read the last element. 
    For instance, recently we were trying to record data on a cRIO device and get the fastest rates possible. We were recieving data from the FPGA FIFO and writing directly to file. When you try to record 32 channels of 32 bits/element at 1 kHz you begin to test the limits of your write to file function. Queues worked better than variables for this because every so many cycles the write function would sort of hiccup and pause, causing the elements in the queue to increase (backup). If we were using regular variables we would have had to wait for the recording to catch up before we could continue reading data. This would mean we would be overflowing the FIFO or missing data points. However, with a queue, elements could back up a little and then the record function would catch up. (As a side note, write to binary file worked faster than TDMS in these benchmark experiments.)
    Can anyone explain it better?
    [will work for kudos]

  • What is the mac pro reset function key?

    what is the mac pro reset function key?

    Sorry, but what "reset function key" are you referring to? What is it you wish to reset?

  • What is the purpose of Destination Function on Submit Button?(Doesn't work)

    Hi Gurus,
    There is a property "Destination Function" on Submit buttons.
    What is the purpose of this field.
    I tried setting some values here expecting following behavior in order:
    1. Process Form Request will get executed.
    2. User will be navigated to the OAF page related to the Destination Function.
    Destination Function property probably point to setInvokeFunction method of the OASubmitButtonBean.
    Please advise on this.
    Thanks and Regards,
    Prince

    Question 2. What is the purpose of View Instance on Submit Button? Is it there for BoundValues? Any examples how can we use this?
    Question 3. Related to Question 2, What is the purpose of View Instance and View Attribute on Button?

  • What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

    Hi experts,
    I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
    1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
    2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
    3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
    Finally, thanks for reading and help.

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • What is the Use of Partner Functions in VM?

    Hi,
    Can someone tell what is the exact use of the Partner Functions (VN, OA, IP,GS etc) maintained in the Partner Function view of Vendor Master? Where exactly are these used?
    PO, GR, Inv, Vend Payment all can be done without maintaining the Partner Functions in VM then why do we need these to be maintained?
    What will happen if we enter different Vendor #'s for differet Partner Functions in VM e.g. 1001, 1002, 1003, 1004 against for VN, OA, IP, GS?
    Thanks.

    if you are doing business with global players, then your vendor is e.g. located in Belgium, but you might order at a sales office in your country, so this sales office need to be created as vendor and you assign this vendor as OA order adress to the venor master of your Belgium vendor.
    The material is then send from a plant in Great Britain, thus this will become the GS partner, that is needed for trade reporting in European Union.
    The invoice is send from the Business Service company of your vendor, this is then partner role PI invocie presenter.
    if you have more than one vendor for the same role, then the buyers will get pop-ups to choose the right one for the PO.

  • Help with Xcode what is the difference between a Function, class and object

    Hi all,
    I'm new here and in programming in Xcode. My question is can somebody tell me what the difference is between functions classes and object. I will appreciate it if you can involve some articels or something else.
    Many thanks,
    RL6001

    Do a Google search for object-oriented programming. When I did, I found the following tutorial, which explains what objects and classes are:
    Object Oriented Programming Tutorial

  • What is the future of SAP Functional Consultant?

    Helo All.
    Can anyone guide me regarding the future of SAP Functional consultants in the wake of impending technologies such as eSOA, Netweaver?
    How these new technologies will change dynamics of job market for functional consultants especially MM and SD?
    What new skills will be required by functional consultants?
    Regards.

    Hi Anay,
    Future of SAP Will Remain Same as of what we have now. Coz Somany Companies Converting To SAP Hugely. And the Core Modules like MM,SD,FI. Will have their Own Significance and will Have the Same Impact what we have now.
    SO Dont Worry About New Technologies. New Technologies will Helps to the Companies to get the Best From Technical Prospective also Helps to the Functional.
    I Dont Think These New technologies Will Change the Functional Market.
    As a Consultant it is better to have knowledge and expert in multiple modules. Nowadays Companies are hireing Multi Specal Functional Consultants.
    SO Dont Worry About The Things.
    Regards,
    Praveen Kumar.

  • What's the authorization to run function CSAP_MAT_BOM_OPEN

    let's say, i wrote a report to change the structure of a BOM, using function CSAP_MAT_BOM_OPEN to open the bom, followed by function CSAP_BOM_ITEM_MAINTAIN and CSAP_MAT_BOM_CLOSE to change the bom and close the bom.
    well, I could use this report while other could not.
    When I used others sap account to run function CSAP_MAT_BOM_OPEN in SE37, I was warned I didn't have the authorization to run this function.
    so i want to know the authorization to use this function.
    best regards.
    Jim

    Hi,
    The std. authorization objects for BOM will be checked (C_STUE_BER, C_STUE_WRK etc).
    Regards,
    Vivek

  • What is the table for partner functions in Billing document

    Hello Experts,
             As per the business requirement my functional consultant included Fright agent (created as a vendor) in  billing document  partner functions,
    so they want to display the name fright agent on the invoice,
    i have checked all the tables related to Billing document, i was unable to find the fright agent  
    I checked in VBPA table (partner function table) (remaining partner functions are there in vbpa table  but fright agent is not there, Is there any function module is available to pick these information ,Please help me in this.

    Read some documentation like [Partner Functions|http://help.sap.com/saphelp_crm40/helpdata/en/3c/92eceb484a11d5980800a0c9306667/frameset.htm], also be aware of the conversion exit on the field PARVW. (check via SM30 on view V_TPAR_SD)
    Regards,
    Raymond

Maybe you are looking for

  • Error while running an application

    When I create a new application and run it, I receive the following error WARNING: Handler execution resulted in exception - forwarding to resolved error view java.lang.IllegalArgumentException: Cannot determine action type for investigation at softl

  • Problem with viewing Adobe PDF documents

    Problem with viewing Adobe PDF documents I have a Windows 7 Home Premium Computer I have read all the suggestions and I have tried downloading multiple versions of Adobe Reader for Windows 7 and Vista from http://get.adobe.com/reader/otherversions/.

  • Problem with scrambling rules

    Good afternoon, I have a problem with the conversion rules, when I transfer the employee does not take into account any of the scrambling rules, those made by me and with the rules that I copied by CNV_TDMS_HCM_SCRAM transaction. I understand that th

  • Getting logon of enterprise portal

    Hi, i would like to know how can i get the userlogon of the sap portal in a ABAP program, i know the function module : ITS_CONTEXT_FIELD_GET but i don't know what is the value of the parameter IV_FIELDNAME to get the userlogon of the portal, i know t

  • Iphone 5 wont charge

    hey my iphone 5 wont really charge with any offical charger (3/4/5/5s) or any 3rd party chargers, via usb or usb 2.0 ive cleaned the charging ports it just seems to charge randomly when it feels like it what can i do to fix this, i have about 5 cable