Regarding query execution

Hi friends,
i am executing query 0figl_c01_q0030 .
while i am doing this one screen is appearing in that i am entering company code = 2000 , gl account = 1112000, current fiscal year = 2007.( all are available in my cube to which i loaded data) .
but it is giving error ." no value could not be found for variable 0p_fvaex "
Please correct me .
Thanks in advance,
ramnaresh.

Hi,
It seems to be problem with SAP Exit Variable: 0P_FVAEX, so check for which country you are checking the data, for INDIA it is April to March is the Finacial year, so in that way check whether data is exists in Cube or not for 2007.
Note: Calender Year is different and Fiscal Year is different.
Thanks
Reddy

Similar Messages

  • How can I reduce BEx Query execution time

    Hi,
    I have a question regarding query execution time in BEx.
    I have a query that takes 45 mins to 1 hour to execute in BEx analyser. This query is run on a daily basis and hence I am keen to reduce the execution time.  Are there any programs or function modules that can help in reducing query execution time?
    Thanks and Regards!

    Hi Sriprakash,
    1.Check if your cube is performance tuned: in the manage cube from RSA1 / performance tab: check if all indexes and statistics are green. Aggregate IDx should as well be.
    2.Condense your cubes regularly
    3. Evaluate the creation of an aggregate with all characteristic used in the query (RSDDV).
    4.Evaluate the creation of a "change run aggregate": based on a standalone NavAttr (without its basic char in the aggr.) but pay attention to the consequent change run when loading master data.
    5. Partition (physically) your cubes systematically when possible (RSDCUBE, menu, partitioning)
    6. Consider logical partitioning (by year or comp_code or ...) and make use of multiproviders in order to keep targets not too big...
    7.Consider creating secondary indexes when reporting on ODS (RSDODS)
    8.Check if the query runtime is due the master data read or the infoprovider itself, or the OLAP processor and/or any other cause in tx ST03N
    9.Consider improving your master reads by creating customized IDX (BITMAP if possible and depending on your data) on master data table and/or attribute SIDs when using NAvs.
    10.Check that your basis team did a good job and have applied the proper DB parameters
    11.Last but not least: fine tune your datamodel precisely.
    hope this will give you an idea.
    Cheers
    Sunil

  • Issue while query execution on web analyser.

    Hi,
    I am getting an error message while query execution on web ie Record set too large , data retrieval restricted by configuration .I am able to run the same query in bex analyser without any issue .Any idea what could be the reason and solution for this issue .
    Regards,
    Neetika.

    Hi Neetika,
    The Query is exceeding the set limits,i suggest you to Reduce the time LIne for the Query, as it may be having more number of Cells in terms of Rows and Columns.
    Execute the Query for Less number of Days,if u r executing it for 1 Month then execute it for 10 Days.
    Rgds
    SVU123

  • SSRS Error : Query execution failed for dataset 'dataSet'. (rsErrorExecutingCommand) Semantic query execution failed. Invalid object name 'RPT.*********'. (rsSemanticQueryEngineError)

    I am new to SSRS and I am trying to migrate reports from 2008 to 2012. As I have so many reports to migrate, I simply got the back up of ReportServer,
    ReportServerTempDB, and Encryption Key and restored them to test environment. I made necessary configuration from RS configuration tool. I am able to see the reports now when I browse //hostname/reports. But when I open any particular report I am getting some
    error.
    · An error has occurred during report processing.
    (rsProcessingAborted)
    Query execution       failed for dataset 'dataSet'.
          (rsErrorExecutingCommand
    Semantic query        execution failed. Invalid object name
           'RPT. ******'. (rsSemanticQueryEngineError)
    ****** - I am assuming this is a custom data class.
    Does anyone have insight on this? or any better way that I can migrate the reports to new server with less efforts.
    I don’t have the reports solution file to deploy the reports, so I have followed backup and restore process.

    Hi Kishore237,
    According to your description, you migrated some reports from Reporting Services (SSRS) 2008 to 2012. Now you get error when accessing the reports on SSRS 2012. Right?
    In this scenario, did you modify the report data source in database after migration? You can try to open the report in Report Builder or Report designer and check the report dataset. If you can preview the report in Report builder or Report designer,
    please try to redeploy the report to Report Server. If it is still not working, please try to restore the database from backup. And for migrating reports, please follow the "Content-Only Migration" in the link below:
    http://msdn.microsoft.com/en-us/library/ms143724(v=sql.110).aspx
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Asset query execution performance after upgrade from 4.6C to ECC 6.0+EHP4

    Hi,guys
    I am encounted a weird problems about asset query execution performance after upgrade to ECC 6.0.
    Our client had migrated sap system from 4.6c to ECC 6.0. We test all transaction code and related stand report and query.
    Everything is working normally except this asset depreciation query report. It is created based on ANLP, ANLZ, ANLA, ANLB, ANLC table; there is also some ABAP code for additional field.
    This report execution costed about 6 minutes in 4.6C system; however it will take 25 minutes in ECC 6.0 with same selection parameter.
    At first, I am trying to find some difference in table index ,structure between 4.6c and ECC 6.0,but there is no difference about it.
    i am wondering why the other query reports is running normally but only this report running with too long time execution dump messages even though we do not make any changes for it.
    your reply is very appreciated
    Regards
    Brian

    Thanks for your replies.
    I check these notes, unfortunately it is different our situation.
    Our situation is all standard asset report and query (sq01) is running normally except this query report.
    I executed se30 for this query (SQ01) at both 4.6C and ECC 6.0.
    I find there is some difference in select sequence logic even though same query without any changes.
    I list there for your reference.
    4.6C
    AQA0FI==========S2============
    Open Cursor ANLP                                    38,702  39,329,356  = 39,329,356      34.6     AQA0FI==========S2============   DB     Opens
    Fetch ANLP                                         292,177  30,378,351  = 30,378,351      26.7    26.7  AQA0FI==========S2============   DB     OpenS
    Select Single ANLC                                  15,012  19,965,172  = 19,965,172      17.5    17.5  AQA0FI==========S2============   DB     OpenS
    Select Single ANLA                                  13,721  11,754,305  = 11,754,305      10.3    10.3  AQA0FI==========S2============   DB     OpenS
    Select Single ANLZ                                   3,753   3,259,308  =  3,259,308       2.9     2.9  AQA0FI==========S2============   DB     OpenS
    Select Single ANLB                                   3,753   3,069,119  =  3,069,119       2.7     2.7  AQA0FI==========S2============   DB     OpenS
    ECC 6.0
    Perform FUNKTION_AUSFUEHREN     2     358,620,931          355
    Perform COMMAND_QSUB     1     358,620,062          68
    Call Func. RSAQ_SUBMIT_QUERY_REPORT     1     358,569,656          88
    Program AQIWFI==========S2============     2     358,558,488          1,350
    Select Single ANLA     160,306     75,576,052     =     75,576,052
    Open Cursor ANLP     71,136     42,096,314     =     42,096,314
    Select Single ANLC     71,134     38,799,393     =     38,799,393
    Select Single ANLB     61,888     26,007,721     =     26,007,721
    Select Single ANLZ     61,888     24,072,111     =     24,072,111
    Fetch ANLP     234,524     13,510,646     =     13,510,646
    Close Cursor ANLP     71,136     2,017,654     =     2,017,654
    We can see first open cursor ANLP ,fetch ANLP then select ANLC,ANLA,ANLZ,ANLB at 4.C.
    But it changed to first select ANLA,and open cursor ANLP,then select  ANLC,ANLB,ANLZ,at last fetch ANLP.
    Probably,it is the real reason why it is running long time in ECC 6.0.
    Is there any changes for query selcection logic(table join function) in ECC 6.0.

  • Query execution time

    Dear SCN,
    I am new to BOBJ Environment. I have created a webi report on top of bex query by using BISC connection. Bex query is build for Vendor Ageing Analysis. My bex query will take very less time to execute the report (max 1 min). But in case of webi is takeing around 5 min when i click on refresh. I have not used any conditions,filters,restrictions are done at webi level all are done at bex level only.
    Please let me know techniques to optimize the query execution time in webi. Currently we are in BO 4.0.
    Regards,
    PRK

    Hi Praveen
    Go through this document for performance optimization using BICS connection
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0e3c552-e419-3010-1298-b32e6210b58d?QuickLink=index&…

  • An error has occurred during report processing. (rsProcessingAborted) Query execution failed for dataset 'dsPriority'. (rsErrorExecutingCommand)

    click report error:
    log file:
    processing!ReportServer_0-2!104c!04/27/2015-19:15:21:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing., ;
     Info: Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing.
     ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'dsPriority'.
     ---> Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException: Query (26, 25) The ALLMEMBERS function expects a hierarchy expression for the  argument. A member expression was used.
       at Microsoft.AnalysisServices.AdomdClient.AdomdDataReader..ctor(XmlReader xmlReader, CommandBehavior commandBehavior, AdomdConnection connection)
       at Microsoft.AnalysisServices.AdomdClient.AdomdCommand.ExecuteReader(CommandBehavior behavior)
       at Microsoft.AnalysisServices.AdomdClient.AdomdCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
       at Microsoft.ReportingServices.DataExtensions.AdoMdCommand.ExecuteReader(CommandBehavior behavior)
       at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSet.RunDataSetQuery()
       --- End of inner exception stack trace ---
       at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSet.RunDataSetQuery()
       at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSet.Process()
       at Microsoft.ReportingServices.OnDemandProcessing.RuntimeParameterDataSet.Process()
       at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSet.ProcessConcurrent(Object threadSet)
       --- End of inner exception stack trace ---
    open http://localhost:8080/tfs/TeamFoundation/Administration/v3.0/WarehouseControlService.asmx?op=ProcessWarehouse click Invoke:
    System.Web.Services.Protocols.SoapException: TF221029: Reporting for Team Foundation Server does not have any warehouse jobs defined. Use the Team Foundation Administration Console to rebuild the reporting. : 2015-04-27T19:30:29:782 ---> System.InvalidOperationException:
    TF221029: Reporting for Team Foundation Server does not have any warehouse jobs defined. Use the Team Foundation Administration Console to rebuild the reporting. at Microsoft.TeamFoundation.Warehouse.WarehouseAdmin.QueueJobs(String collectionName, String jobName)
    at Microsoft.TeamFoundation.Warehouse.WarehouseControlWebService.ProcessWarehouse(String collectionName, String jobName) --- End of inner exception stack trace --- at Microsoft.TeamFoundation.Warehouse.WarehouseControlWebService.ProcessWarehouse(String collectionName,
    String jobName)

    Hi shelman,
    I'd like to know whether you configured TFS reporting service properly, and if you can get the report normally before. From the error message, you might has wrong data source or the parameters of the dataset 'dsPriority'. You can check whether the data source
    for your report is available, try to use windows authentication. Or check the parameters of dataset 'dsPriority' make sure the query works when you execute it manually.
    To process the TFS data warehouse and analysis services cube, I'd like to know which operation you selected before clicking Invoke button. Please follow the instructions on this
    page to process TFS data warehouse and analysis service cube manually. You can also refer the James's last reply in this
    thread or this
    blog to check if the solutions work for you.
    Another option is run TFS best practice analyzer to check if there any configure issues on your TFS server machine. And check event logs to see if there any useful information, elaborate more details about your scenario including reproduce steps if the problem
    persists.
    Best regards,

  • Query Execution/Elapsed Time and Oracle Data Blocks

    Hi,
    I have created 3 tables with one column only. As an example Table 1 below:
    SQL> create table T1 ( x char(2000));
    So 3 tables are created in this way i.e. T1,T2 and T3.
    T1 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production) (O.S=Windows).
    T2 = I created in a Tablespace with Blocksize 16k.
    T3 = I created in a Tablespace with Blocksize 4k. In the same Instance.
    Each table has approx. 500 rows (So, table sizes are same in all the cases to test Query execution time ). As these 3 tables are created under different data block sizes so the ALLOCATED no. of data blocks are different in all cases.
    T1  =   8k  = 256 Blocks =  00:00:04.76 (query execution time/elapsed time)
    T2  = 16k=121 Blocks =  00:00:04.64
    T3 =   4k =  490 Blocks =  00:00:04.91
    Table Access is FULL i.e. I have used select * from table_name; in all 3 cases. No Index nothing.
    My Question is why query execution time is nearly the same in all 3 cases because Oracle has to read all the data blocks in each case to fetch the records and there is a much difference in the allocated no. of blocks ???
    In 4k block size example, Oracle has to read just 121 blocks and it's taking nearly the same time as it's taking to read 490 blocks???
    This is just 1 example of different data blocks. I have around 40 tables in each block size tablespace and the result are nearly the same. It's very strange for me because there is a much difference in the no. of allocated blocks but execution time is almost the same, only difference in milliseconds.
    I'll highly appreciate the expert opinions.
    Bundle of thanks in advance.
    Best Regards,

    Hi Chris,
    No I'm not using separate databases, it's 8k database with non-standard blocksizes of 16k and 4k.
    Actually I wanted to test the Elapsed time of these 3 tables, so for that I tried to create the same size
    tables.
    And how I equalize these is like I have created one column table with char(2000).
    555 MB is the figure I wanted to use for these 3 tables ( no special figure, just to make it bigger than the
    RAM used for my db at the db startup to be sure of not retrieving the records from cache).
    so row size with overhead is 2006 * 290,000 rows = 581740000(bytes) / 1024 = 568105KB / 1024 = 555MB.
    Through this math calculation I thought It will be the total table size. So I Created the same no. of rows in 3 blocksizes.
    If it's wrong then what a mes because I was calculating tables sizes in the same way from the last few months.
    Can you please explain a little how you found out the tables sizes in different block sizes.Though I understood how you
    calculated size in MB from these 3 block sizes
    T8K =97177 BLOCKS=759MB *( 97177*8 = 777416KB / 1024 = 759MB )*
    T16K=41639 BLOCKS=650MB
    BT4K=293656 BLOCKS=1147MB
    For me it's new to calculate the size of a table. Can you please tell me then how many rows I can create in each of
    these 3 tables to make them equal in MB to test for elapsed time.
    Then I'll again run my test and put the results here. Because If I've wrongly calculated table sizes then there is no need to talk about elapsed time. First I must equalize the table sizes properly.
    SQL> select sum(bytes)/1024/1024 "Size in MB" from dba_segments> 2 where segment_name = 'T16K';
    Size in MB
    655
    Is above SQL is correct to calculate the size or is it the correct alternative way to your method of calculating the size??
    I created the same table again with everything same and the result is :
    SQL> select num_rows,blocks from user_tables where table_name = 'T16K';NUM_ROWS BLOCKS
    290000 41703
    64 more blocks are allocated this time so may be that's y it's showing total size of 655 instead of 650.
    Thanks alot for your help.
    Best Regards,
    KAm
    Edited by: kam555 on Nov 20, 2009 5:57 PM

  • Query Execution Filter Val. Selection take no effect on query based on AG

    Hi,
    by setting the 'Query Execution Filter Val. Selection' property in query, we can control the value list when we execute the query. with setting 'Only posted value values for navigation', only the data posted to cube can be listed when you do the selection in the Query Execution selection screen and with setting 'values in master data table', all the date will be listed when you do the selection in the Query Execution selection screen.
    1. but for queries based on cube or multi-cube, when i select 'values in master data table' in query defination, still only the posted value is displayed when i do the selection in the Query Execution selection screen. is there anyone know why?
    2. for queries based on aggregation level, whatever setting i choose, all the values is displayed when i do the selection in the Query Execution selection screen. how i can do select the posted value for this kind of query?
    Many Thanks
    Jonathan

    I apologize I meant the other link:
    I will put the useful text from that link here.
    Regarding the query built on aggregation level please note the following
    the aggregation level is always a Virtual Provider built other
    InfoProvider and hence it does not have the dimension table and hence
    the F4 mode D is not supported.
    Therefore when aggregation level is used in a query, F4 does not supportD-mode: 'Only Values in InfoProvider' and all master data values are
    displayed in the value list.
    Reference from the note
    984229 F4 modes for input help as of SAP NetWeaver 2004s BI
    4. Since other InfoProviders do not have a dimension table, the system
    displays only posted values if you select "Only Posted Values for
    Navigation". Otherwise, it displays the values from the master data
    table.
    Hope this should clarify your doubts. Please let me know if you have
    questions else please confirm the message at your earliest convenie
    Edited by: Abhijit N on Apr 2, 2009 6:06 PM

  • Doubt regarding SQL execution

    Hi Friends,
    Am using Oracle 10g DB - 10.2.0.3.0
    I have some basic doubts regarding sql query execution by Oracle.
    Say, Am executing a query from a toad/sqlplus session for the first time, it takes 10 secs then 1 sec and so on.
    Same thing happens for every 15 minutes.(Any specific reason for this ??).
    It takes more time when it executes first because of parsing and all those stuff but from then on it picks from the
    shared pool right??.. How long will it be there in Shared Pool does Oracle maintain any specific time period to clear that query from shared pool memory. How does Oracle handle this.
    Another thing is, say, I have a report query, I run this query monthly. What will be the execution time when I run this query each and every month. Will Oracle parse this query everytime I run. How do I improve the performance in this situation (May sound odd :)).
    Regards,
    Marlon

    Say, Am executing a query from a toad/sqlplus session for the first time, it takes 10 secs then 1 sec and so on.
    Same thing happens for every 15 minutes.(Any specific reason for this ??).
    It takes more time when it executes first because of parsing and all those stuff but from then on it picks from the
    shared pool right??.. How long will it be there in Shared Pool does Oracle maintain any specific time period to clear that query from shared pool memory. How does Oracle handle this. Share Pool caches the SQL statement. So when you execute the same SQL for the second time it goes for a soft parse. But this is not the only reason for the query to execute faster the second time. The time difference between a soft parse and hard parse is very minimal. So it really does not matter unless you are executing the same query several number of times.
    The thing that really matters is the Data Buffer Cache. That is the rows that are selected by your query are cached into the Data buffer that is available in the SGA. So for the next time when you run the same query the IO is reduced as the data is available in the memory and you don't have to go to your disk to get the data.
    But the data in Data Buffer is not persistent, meaning it follows the FIFO rule. That is first in first out. When the Data Buffer is full the content of the buffer is removed in the FIFO order.
    Another thing is, say, I have a report query, I run this query monthly. What will be the execution time when I run this query each and every month. Will Oracle parse this query every time I run. How do I improve the performance in this situation (May sound odd :)). Like the Data Buffer the Shared Pool is also maintained in the FIFO order. So if the query is still in the Shared Pool the query will be soft parsed else it will be hard parsed. But its very rare that you will have a query in your Shared Pool for a month.

  • Query execution process in OBIEE 11g

    Hi all,
    I am confused with Web logic server, enterprise manager server and other components of
    Obiee 11g architecture with respect to query execution in Answers of Presentation services.
    Please explain me in detail...from the login page i.e when a user logins
    into the presentation services for query request. Explain how exactly the various
    servers communicates starting from logging into presentation services (how exactly user authenticates),
    then query execution (which servers communicates). I am confused with the flow of query process.
    Regards
    Chandra kanth.

    Gurus and Experts,
    Please take your valuable time to answer my question.
    regards
    chandra kanth.

  • Finding number of working days during query execution

    Hi ,
    We have a requirement to calculate number of working days during query execution. In the cube we got "received date", this will be used as a variable in the query. Based on the received date value entered, query needs to display number of products received from past 1, 2,3,4 days (working days should include weekends or public holidays).
    1day     2 days     3 days     4 days   5 days 
    10         12            20            15          20
    to me it appears as I need to create virtual key figures.
    Regards,
    Ramz

    Hi ramesh,
    First try to create formula variables for start data and end date to calculate the no of working days.
    Create a Variable ZSTDT --of type replacement path.
    Type of Variable = Formula
    Variable Name = ZSTDT
    Characteristic = <info object>
    For Intervals Use = Select From Value
    Offset Start = 0000 Offset Length = 0000
    Replacement var with : key
    use the same steps to create one more formula variable to get end date.
    Now create a formula to get the No of days.
    once after getting no of days you can create buckets as per your need.
    for more info check the below links
    http://www.sd-solutions.com/SAP-HCM-BW-Replacement-Path-Variables.html
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f15839-0cf1-2b10-c6a7-ebe68cc87cdc?quicklink=index&overridelayout=true

  • Index slows down query execution

    Hello everybody,
    I have reordered the join conditions for the query...
    select (first_name||' '||middle_name||' '||last_name) name,regn_no,age,gender,
    (select loc_name from locations where loc_id=location_code and loc_h_id='L6') district,
    person_id from persons p,musers u where reg_center_id=u.center_id and
    p.ipop='RG' and u.user_id = '8832' and u.eff_end_dt is null and p.CID = '1' order by p.crt_dt desc
    like this...
    select (first_name||' '||middle_name||' '||last_name) name,regn_no,age,gender,
    (select loc_name from locations where loc_id=location_code and loc_h_id='L6') district,
    person_id from musers u, persons p where reg_center_id=u.center_id and u.user_id = '8832'
    and p.ipop='RG' and u.eff_end_dt is null and p.CID = '1'
    because
    select count(*) from persons p, musers u where reg_center_id=u.center_id and
    p.ipop='RG' is 13002
    and
    select count(*) from persons p, musers u where reg_center_id=u.center_id and u.user_id = '8832' is 1007.
    In this excercise I have a couple of questions..
    1. This did not show any difference in the CPU time.
    and,
    I have created an index 'idx_ipop_persons' on persons(ipop) "create index idx_ipop_persons on persons(ipop)".
    2. The query is taking more time to execute than it was before creating the index.
    Please help me...
    Thanks,
    Aswin.

    Please post the execution plan for your query.
    And also i need some details:
    select count(*) from person where ipop='RG';
    How many records fetch?
    select distinct ipop from persons; --How many
    records fetch?
    Regards
    RajaBaskar
    Execution plan:
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=921 Card=176 Bytes
    =11088)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'LOCATIONS' (TABLE)
    (Cost=2 Card=1 Bytes=38)
    2 1 INDEX (RANGE SCAN) OF 'IDX_LOCID_LOCHDR_LOCATIONS' (INDE
    X) (Cost=1 Card=1)
    3 0 TABLE ACCESS (BY INDEX ROWID) OF 'PERSONS' (TABLE) (
    Cost=918 Card=176 Bytes=9152)
    4 3 NESTED LOOPS (Cost=921 Card=176 Bytes=11088)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'MUSERS' (TA
    BLE) (Cost=3 Card=1 Bytes=11)
    6 5 INDEX (RANGE SCAN) OF 'PK_MUSERS' (INDEX (UNIQUE)
    ) (Cost=2 Card=1)
    7 4 INDEX (RANGE SCAN) OF 'IDX2_PERSONS' (INDEX) (Co
    st=1 Card=1464)
    select count(*) from person where ipop='RG';
    count(*)
    12135
    select distinct ipop from persons;
    distinct ipop
    RG
    OP
    IP
    RF
    CR

  • Query execution slow

    Hi Experts,
    I have problem with query execution. It is taking more time to execution.
    Query is like this :
    SELECT   gcc_po.segment1 bc,
             gcc_po.segment2 rc,
             gcc_po.segment3 dept,
             gcc_po.segment4 ACCOUNT,
             gcc_po.segment5 product,
             gcc_po.segment6 project,
             gcc_po.segment7 tbd,
             SUBSTR (pv.vendor_name, 1, 50) vendor_name,
             pv.vendor_id,
             NVL (ph.closed_code, 'OPEN') status,
             ph.cancel_flag,
             ph.vendor_site_id,
             ph.segment1 po_number,
             ph.creation_date po_creation_date,
             pv.segment1 supplier_number,
             pvsa.vendor_site_code,
             ph.currency_code po_curr_code,
             ph.blanket_total_amount,
             NVL (ph.rate, 1) po_rate,
             SUM (DECODE (:p_currency,
                          'FUNCTIONAL', DECODE (:p_func_curr_code,
                                                ph.currency_code, NVL
                                                                (pd.amount_billed,
                                                                 0),
                                                  NVL (pd.amount_billed, 0)
                                                * NVL (ph.rate, 1)
                          NVL (pd.amount_billed, 0)
                         )) amt_vouchered,
             ph.po_header_id poheaderid,
             INITCAP (ph.attribute1) po_type,
             DECODE (ph.attribute8,
                     'ARIBA', DECODE (ph.attribute4,
                                      NULL, ph.attribute4,
                                      ppf.full_name
                     ph.attribute4
                    ) origanator,
             ph.attribute8 phv_attribute8,
             UPPER (ph.attribute4) phv_attribute4
        FROM po_headers ph,
             po_vendors pv,
             po_vendor_sites pvsa,
             po_distributions pd,
             gl_code_combinations gcc_po,
             per_all_people_f ppf
       WHERE ph.segment1 BETWEEN '001002' AND 'IND900714'
         AND ph.vendor_id = pv.vendor_id(+)
         AND ph.vendor_site_id = pvsa.vendor_site_id
         AND ph.po_header_id = pd.po_header_id
         AND gcc_po.code_combination_id = pd.code_combination_id
         AND pv.vendor_id = pvsa.vendor_id
         AND UPPER (ph.attribute4) = ppf.attribute2(+) -- no  index on attributes
         AND ph.creation_date BETWEEN ppf.effective_start_date(+) AND ppf.effective_end_date(+)
    GROUP BY gcc_po.segment1,-- no index on segments
             gcc_po.segment2,
             gcc_po.segment3,
             gcc_po.segment4,
             gcc_po.segment5,
             gcc_po.segment6,
             gcc_po.segment7,
             SUBSTR (pv.vendor_name, 1, 50),
             pv.vendor_id,
             NVL (ph.closed_code, 'OPEN'),
             ph.cancel_flag,
             ph.vendor_site_id,
             ph.segment1,
             ph.creation_date,
             pvsa.attribute7,
             pv.segment1,
             pvsa.vendor_site_code,
             ph.currency_code,
             ph.blanket_total_amount,
             NVL (ph.rate, 1),
             ph.po_header_id,
             INITCAP (ph.attribute1),
             DECODE (ph.attribute8,
                     'ARIBA', DECODE (ph.attribute4,
                                      NULL, ph.attribute4,
                                      ppf.full_name
                     ph.attribute4
             ph.attribute8,
             ph.attribute4Here with out SUM funciton and group by function its execution is fast. if i use this Sum function and Group by function it is taking nearly 45 mins.
    Explain plan for this:
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=ALL_ROWS          1             6364                              
      HASH GROUP BY          1       272       6364                              
        NESTED LOOPS OUTER          1       272       6363                              
          NESTED LOOPS          1       232       6360                              
            NESTED LOOPS          1       192       6358                              
              NESTED LOOPS          1       171       6341                              
                HASH JOIN          1 K     100 K     2455                              
                  TABLE ACCESS FULL     PO_VENDOR_SITES_ALL     1 K     36 K     1683                              
                  TABLE ACCESS FULL     PO_VENDORS     56 K     3 M     770                              
                TABLE ACCESS BY INDEX ROWID     PO_HEADERS_ALL     1       82       53                              
                  INDEX RANGE SCAN     PO_HEADERS_N1     69             2                              
              TABLE ACCESS BY INDEX ROWID     PO_DISTRIBUTIONS_ALL     1       21       17                              
                INDEX RANGE SCAN     PO_DISTRIBUTIONS_N3     76             2                              
            TABLE ACCESS BY INDEX ROWID     GL_CODE_COMBINATIONS     1       40       2                              
              INDEX UNIQUE SCAN     GL_CODE_COMBINATIONS_U1     1             1                              
          TABLE ACCESS BY INDEX ROWID     PER_ALL_PEOPLE_F     1       40       3                              
            INDEX RANGE SCAN     PER_PEOPLE_F_ATT2     2             1                               plz giv me solution for this.....Whihc Hints shall i use in this query.....
    thanks in ADV....

    I have a feeling this will lead us nowhere, but let me try for the last time.
    Tuning a query is not about trying out all available index hints, because there must be one that makes the query fly. It is about diagnosing the query. See what it does and see where time is being spent. Only after you know where time is being spent, then you can effectively do something about it (if it is not tuned already).
    So please read about explain plan, SQL*Trace and tkprof, and start diagnosing where your problem is.
    Regards,
    Rob.

  • Query execution time estimation....

    Hi All,
    Is it possible to estimate query execution time using explain plan?
    Thanks in advance,
    Santosh.

    The cost estimated by the cost based optimizer is actually representing the time it takes to process the statement expressed in units of the single block read-time. Which means if you know the estimated time a single block read request requires you can translate this into an actual time.
    Starting with Oracle 9i this information (the time to perform single block/multi block read requests) is actually available if you gather system statistics.
    And this is what 10g actually does, as it shows an estimated TIME in the explain plan output based on these assumptions. Note that 10g by default uses system statistics, even if they are not explicitly gathered. In this case Oracle 10g uses the NOWORKLOAD statistics generated on the fly at instance startup.
    Of course the time estimates shown by Oracle 10g may not even be close to the actual execution time as it is only an estimate based on a model and input values (statistics) and therefore might be way off due to several reasons, the same applies in principle to the cost shown.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

Maybe you are looking for