Query performance affected with use of package.function in 11g

Hi,
I have a view that helps select account details for a particular account and use that in a form. The query in the view is:
select acc.* from accounts acc where acc.account_no = pkgacc.fGetAccNo;
Here "pkgacc" is a package that has set and get methods. ACCOUNT_NO is the PK for ACCOUNTS table. This same query when run in a 10g database makes use of the PK INDEX. However in 11g it does a FULL SCAN.
Regards

Hi,
1/ Volume is the same
2/ All statistics are up to date
10g Plan
Plan     
SELECT STATEMENT ALL_ROWS
Cost: 18 Bytes: 462 Cardinality: 3      
     23 NESTED LOOPS      
          21 NESTED LOOPS
          Cost: 18 Bytes: 462 Cardinality: 3      
               19 VIEW VIEW SYS.VW_NSO_1
               Cost: 12 Bytes: 39 Cardinality: 3      
                    18 HASH UNIQUE
                    Cost: 12 Bytes: 110 Cardinality: 3      
                         17 UNION-ALL      
                              2 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.OLD_ACCOUNT_LINKS
                              Cost: 0 Bytes: 25 Cardinality: 1      
                                   1 INDEX RANGE SCAN INDEX SUMMIT.OACCL_2
                                   Cost: 0 Cardinality: 1      
                              8 NESTED LOOPS      
                                   6 NESTED LOOPS
                                   Cost: 7 Bytes: 40 Cardinality: 1      
                                        4 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.ACCOUNTS
                                        Cost: 4 Bytes: 18 Cardinality: 1      
                                             3 INDEX RANGE SCAN INDEX (UNIQUE) SUMMIT.ACC_PRIME
                                             Cost: 3 Cardinality: 1      
                                        5 INDEX RANGE SCAN INDEX SUMMIT.ACCL_2
                                        Cost: 2 Cardinality: 1      
                                   7 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.ACCOUNT_LINKS
                                   Cost: 3 Bytes: 22 Cardinality: 1      
                              16 NESTED LOOPS
                              Cost: 5 Bytes: 45 Cardinality: 1      
                                   14 MERGE JOIN CARTESIAN
                                   Cost: 5 Bytes: 30 Cardinality: 1      
                                        10 TABLE ACCESS BY INDEX ROWID TABLE CVC.ACT01
                                        Cost: 3 Bytes: 15 Cardinality: 1      
                                             9 INDEX RANGE SCAN INDEX (UNIQUE) CVC.PK_ACT01
                                             Cost: 2 Cardinality: 1      
                                        13 BUFFER SORT
                                        Cost: 2 Bytes: 30 Cardinality: 2      
                                             12 TABLE ACCESS BY INDEX ROWID TABLE CVC.ACF02
                                             Cost: 2 Bytes: 30 Cardinality: 2      
                                                  11 INDEX RANGE SCAN INDEX (UNIQUE) CVC.PK_ACF02
                                                  Cost: 1 Cardinality: 2      
                                   15 INDEX UNIQUE SCAN INDEX (UNIQUE) CVC.PK_BIT41
                                   Cost: 0 Bytes: 15 Cardinality: 1      
               20 INDEX UNIQUE SCAN INDEX (UNIQUE) SUMMIT.CUST_PRIME
               Cost: 1 Cardinality: 1      
          22 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.CUSTOMERS
          Cost: 2 Bytes: 141 Cardinality: 1      
11g Plan
Plan     
SELECT STATEMENT ALL_ROWS
Cost: 1,136,322 Bytes: 138,218,223,528 Cardinality: 897,520,932      
     19 HASH JOIN
     Cost: 1,136,322 Bytes: 138,218,223,528 Cardinality: 897,520,932      
          1 TABLE ACCESS FULL TABLE SUMMIT.CUSTOMERS
          Cost: 14,455 Bytes: 355,037,154 Cardinality: 2,517,994      
          18 VIEW VIEW SYS.VW_NSO_1
          Cost: 20,742 Bytes: 11,685,473,072 Cardinality: 898,882,544      
               17 HASH UNIQUE
               Cost: 20,742 Bytes: 35,955,720,360 Cardinality: 898,882,544      
                    16 UNION-ALL      
                         3 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.OLD_ACCOUNT_LINKS
                         Cost: 0 Bytes: 25 Cardinality: 1      
                              2 INDEX RANGE SCAN INDEX SUMMIT.OACCL_2
                              Cost: 0 Cardinality: 1      
                         8 HASH JOIN
                         Cost: 20,354 Bytes: 35,951,952,800 Cardinality: 898,798,820      
                              5 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.ACCOUNTS
                              Cost: 5,398 Bytes: 1,400,292 Cardinality: 77,794      
                                   4 INDEX RANGE SCAN INDEX (UNIQUE) SUMMIT.ACC_PRIME
                                   Cost: 102 Cardinality: 28,006      
                              7 TABLE ACCESS BY INDEX ROWID TABLE SUMMIT.ACCOUNT_LINKS
                              Cost: 4,634 Bytes: 4,575,208 Cardinality: 207,964      
                                   6 INDEX RANGE SCAN INDEX SUMMIT.ACCL_2
                                   Cost: 145 Cardinality: 37,433      
                         15 HASH JOIN
                         Cost: 388 Bytes: 3,767,535 Cardinality: 83,723      
                              10 TABLE ACCESS BY INDEX ROWID TABLE CVC.ACT01
                              Cost: 271 Bytes: 4,065 Cardinality: 271      
                                   9 INDEX RANGE SCAN INDEX (UNIQUE) CVC.PK_ACT01
                                   Cost: 3 Cardinality: 342      
                              14 HASH JOIN
                              Cost: 115 Bytes: 92,580 Cardinality: 3,086      
                                   12 TABLE ACCESS BY INDEX ROWID TABLE CVC.ACF02
                                   Cost: 76 Bytes: 46,290 Cardinality: 3,086      
                                        11 INDEX RANGE SCAN INDEX (UNIQUE) CVC.PK_ACF02
                                        Cost: 4 Cardinality: 555      
                                   13 INDEX FAST FULL SCAN INDEX (UNIQUE) CVC.PK_BIT41
                                   Cost: 38 Bytes: 557,220 Cardinality: 37,148

Similar Messages

  • Using a packaged function in a query

    Hi ,
    I have read the following statement (correct option for the question)in 1z0-147 questions.
    The question is :: WHEN USING A PACKAGED FUNCTION IN A QUERY which of the following is true ::
    The packaged function cannot execute DML statements against the table that is being queriedI tried the following to understand the above statement
    create or replace package test_pk is
    function fn_test(i number) return number ;
    end;
    create or replace package body test_pk is
    function fn_test (i number) return number is
      j number:=1;
    begin
        insert into a values(200,300);
        commit;
       return j;
       end;
    end test_pk;  Upon executing the above function in the select statement
    select TEST_PK.FN_TEST(1) from dualI got the error saying that Can't perform DML Inside SElect
    Is this example for the above statement is TRUE ????
    Could you please explain me if my example is wrong
    Thanks
    Edited by: Smile on Nov 22, 2012 9:47 AM

    No, it is not true. Any function used in SQL is not allowed to perform a DML operation other than SELECT regardless if it is against the table that is being queried or not. Select is allowed against any table. And function in your example does INSERT which is not allowed. Also, Any function used in SQL is not allowed to perform commit/rollback/savepoint.
    SY.
    Edit: unless function is autonomous transaction.
    Edited by: Solomon Yakobson on Nov 22, 2012 10:22 AM

  • Performance issue with using MAX function in pl/sql

    Hello All,
    We are having a performance issue with the below logic wherein MAX is being used in order to get the latest instance/record for a given input variable ( p_in_header_id).. the item_key is having the format as :
    p_in_header_id - <number generated from a sequence>
    This query to fetch even 1 record takes around 1 minutes 30 sec..could someone please help if there is a better way to form this logic & to improve performance in this case.
    We want to get the latest record for the item_key ( this we are getting using MAX (begin_date)) for a given p_in_header_id value.
    Query 1 :
    SELECT item_key FROM wf_items WHERE item_type = 'xxxxzzzz'
    AND SUBSTR (item_key, 1, INSTR (item_key, '-') - 1) =p_in_header_id
    AND root_activity ='START_REQUESTS'
    AND begin_date =
    (SELECT MAX (begin_date) FROM wf_items WHERE item_type = 'xxxxzzzz'
    AND root_activity ='START_REQUESTS'
    AND SUBSTR (item_key, 1, INSTR (item_key, '-') - 1) =p_in_header_id);
    Could someone please help us with this performance issue..we are really stuck because of this
    regards

    First of all Thanks to all gentlemen who replied ..many thanks ...
    Tried the ROW_NUMBER() option but still it is taking time...have given output for the query and tkprof results as well. Even when it doesn't fetch any record ( this is a valid cased because the input header id doesn't have any workflow request submitted & hence no entry in the wf_items table)..then also see the time it has taken.
    Looked at the RANK & DENSE_RANK options which were suggested..but it is still taking time..
    Any further suggestions or ideas as to how this could be resolved..
    SELECT 'Y', 'Y', ITEM_KEY
    FROM
    ( SELECT ITEM_KEY, ROW_NUMBER() OVER(ORDER BY BEGIN_DATE DESC) RN FROM
    WF_ITEMS WHERE ITEM_TYPE = 'xxxxzzzz' AND ROOT_ACTIVITY = 'START_REQUESTS'
    AND SUBSTR(ITEM_KEY,1,INSTR(ITEM_KEY,'-') - 1) = :B1
    ) T WHERE RN <= 1
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 1 0.00 1.57 0 0 0 0
    Fetch 1 8700.00 544968.73 8180 8185 0 0
    total 2 8700.00 544970.30 8180 8185 0 0
    many thanks

  • Performance problems with use SCOPE instruction?

    Hi All!
    We have application work with cube bases on SSAS 2008 R2. Also we use writeback function for change data in cube.
    Now I'm looking bottleneck in our queries.
    We have following MDX query(for example):
    select
    non empty{
    ([Date].[Date].[All].children
    , [Forecast Type].[Forecast Type].[All].children
    , [Stock].[Stock].[All].children
    , [Shipment].[Shipment].[All].children
    , [Invoice].[Invoice].[All].children
    , [Way Bill External].[Way Bill External].[All].children
    , [SD User].[User].[All].children
    , [SD Date].[Date].[All].children
    , [CD User].[User].[All].children
    , [CD Date].[Date].[All].children
    , [Forecast Basis].[Forecast Basis].[All].children
    , [Orders].[Orders].[All].children
    , [Rolling Forecast].[Rolling Forecast].[All].children
    , [Long Range Forecast].[Long Range].[All].children
    , [Calculated FCCR].[Calc Price].[All].children
    , [Write Table Guids].[GuidObj].[All].children)
    } dimension properties member_unique_name
    , member_type
    , member_value on rows
    , non empty {({[Measures].[Price CR]
    , [Measures].[Cost]
    , [Measures].[Cost USD]
    , [Measures].[Cost LME]
    , [Measures].[Cost MWP]
    , [Measures].[Weight]
    , [Measures].[Weight Real]})} dimension properties member_unique_name
    , member_type
    , member_value on columns
    from [MainCubeFCT]
    where ({[Currency].[Currency].&[4]}
    , {[Forecast Basis].[Customer].&[4496]}
    , {[Forecast Basis].[Consignee].&[4496]}
    , {[Forecast Condition].[Forecast Condition].&[1]}
    , {[Forecast Basis].[Alloy].&[56]}
    , {[Date].[Year Month].[Month].&[2015-05-01T00:00:00]}
    , {[Date Type].[Date Type].&[2]}
    , {[Forecast Basis].[Business Sphere2].&[4]}
    , {[Forecast Status].[Forecast Status].&[2]})
    Duration execution this query(Query end):
    cold(after clear cache) - 1000
    warm - 500
    Max loss on Calculate Non empty event - 95%.
    After some operations I found bottleneck in 2 measures: [Measures].[Weight], [Measures].[Price CR]
    If them deleted from query then duration execution equals 50.
    In our cube measure [Measures].[Weight] override in calculation as: 
    scope([Measures].[Weight]);
    This = iif((round([Measures].[Weight], 3)<>0), round([Measures].[Weight], 3), null);
    end scope;
    But if I change code as 
    scope([Measures].[Weight]);
    This = [Measures].[Weight];
    end scope;
    Performance query does not improve...
    If delete this override from calculation in cube. I get good performance acceptable to me.
    We need to keep the business logic and get acceptable performance.
    What wrong in measures, calculations or query? Any ideas?
    If need additional information let me know.
    Many thanks, Dmitry.

    Hi Makarov,
    According to your description, you get performance issue when using SCOPE() statement. Right?
    In Analysis Services, when using SCOPE() statement, it redefines that part of your cube space while the calculated member is much more isolated. In this scenario, I suggest you directly create a measure. Because calculated measure only returns values
    where the amounts are recorded directly to the parent without including children values.
    Reference:
    Analysis Services Query Performance Top 10 Best Practices
    Top 3 Simplest Ways To Improve Your MDX Query
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Poor query performance only with migrated 7.0 queries

    Dear Team,
    We are facing a serious query performance issue after migration of queries from 3.5 to 7.0.
    I executed a query in 3.5 with some variable values which takes fraction of seconds to display the output. But the same migrated query with same variable entries is taking very long time and giving time out error.
    We are not using any aggregates in the InfoProvider level.
    Both the queries are based on same cube but 3.5 query is taking less time and 7.0 is taking very long time if more selection is done.
    I checked for notes where I didn't find specific note for this particular scenario. I found notes only for general query performance improvement.
    I want to know the reason why only in 7.0 the same 3.5 query is taking a long time and giving time out error. And please suggest some notes or suggestions related to this scenario.
    Regards,
    Chan

    Hi,
    Queries in BI 7.0 are almost the same as queries in 3.x format.
    inorder to check if the problem is in the query runtime (database time) or JAVA runtime (probably rendering) you should try running it from RSRT once in JAVA web and once in ABAP web.
    if the problem is only with JAVA web, than u should take the URL and add &profiling=X at the end.
    after the query execution u can use statistics which will be shown at the top of the page.
    With my experience, the problem is in the rendering phase of the query. Things that could be done is to limit the number of rows shown at each page, that could be done by changing the 0ANALYSIS web template - it's one of the web template parameters.
    Tomer.

  • How to use type, packages, functions, and procedures in another schema ?

    I have two target schema in one OWB project, such as A and B. In a mapping of A, I would like to use some types, packages, functions, and procedures from B. I have tried the method of synonym as suggested, but I could not find the metadata of these when importing ... The only type of synonym I can import is the synonym for table. Is there a bug for synonym?
    If I cannot use synonym for this issue, is there another way to solve the problem?

    Now, in some instances you will absolutely need to create the second module as Carsten describes, however it should also be noted that you can reference objects in things like Expressions even if you have not loaded up the metadata. It is only when you need strong binding that it becomes neccessary to import objects. For everything else, as long as the reference will resolve at compile-time then you are good to go.
    For example, I have a function in one target schema (S1) and a private synonym to it in another(s2). A mapping in the S2 schema has an expression object that uses the synonym to the function in the expression property for a couple of the output attirbutes. The synonym has not been loaded into metadata - indeed OWB has no knowledge of its existance. But it resolves at compile time so the mapping validates and generates successfully.
    Mike

  • Having trouble with using variables in functions and after functions..

    Morning,
    I have simplified this, as it represents the core of what’s I obviously don't know how to do. 
    Problem:
    Say I populate that variable by reading in a list if IP addresses from file, finding the line that matches the hostname and place that string into the $IPAddress variable for use later throughout the script.   I did not run into a significant problem
    until I decided to convert the routine of looking up the IP address and populating the variable into a function.   As soon as I made it a function, and called that function, the $IPAddress variable only had the data in it until the function completed. 
    Once the function had done its work, and had placed the data into the variable, I expected that “new” data to be available after the function had completed..in that variable.  But it’s like the $IPAddress variable in the main script is a totally
    different data then the variable with the same name that’s used within the function. 
    So I think this demonstrates some of what’s kicking my butt.. 
    $IPAddress = "This is the wrong data”
    Function TestFunction () 
    $IPAddress  #call to display the contents of the variable at the start of the function. 
    $IPAddress = Read-Host -Prompt "Please enter the text ‘Goober’" 
    $IPAddress   #call to display the contents of the variable at the end of the function. 
    TestFunction
    $IPAddress ​
    The output I get is: 
    This is the wrong data
    "Please enter ‘Goober’"  : where I enter Goober
    Goober
    This is the wrong data
    Huh? 
    I had expected:
    This is the wrong data
    "Please enter ‘Goober’"  : where I enter Goober
    Goober
    Goober
    What good is the repeatability of a function if it’s output is lost? 

    THis seems to work.. IS there any reason NOT to do this?
    $Global:IPAddress= "This is the wrong data” #"
    Function TestFunction{
        Write-Host $IPAddress-fore green
          $host.ui.RawUI.FlushInputBuffer()
         $Global:IPAddress =
    Read-Host -Prompt
    "Please enter the text ‘Goober’"
        return$Global:IPAddress
    TestFunction
    return$Global:IPAddress

  • Performance issue with using buffering in a APPL0 or APPL1 Table

    Hi,
    Can anyone please tell me whether there's any serious performace issue with using buffering for a Master or Transaction table? I'm asking this because when I run code inspector for my transp table I'm getting information message:
    Message Code 0011 ==> Buffereing is Activated but Delivery Class Is "A" and Message Code 0014 ==> Buffereing is Activated but Data Class Is "APPL1".
    So what's other way round for improving performance.
    Thanks,
    Mahesh M.S.

    Hi,
    have you read the documentation?
    Let me paste it here for you:
    Buffering is switched on for the examined table and it has data type 'APPL0' or 'APPL1'.
    Tables with data type 'APPL0' or 'APPL1' should contain master or transaction data, so these tables should either contain a large amount of data or their content should change frequently. Therefore buffering the table is unfavourable. Very large tables suppress other tables in the buffer memory and hence slow done any access to them. Transaction data should not be buffered because the synchronization of the changes on the various application servers is very time consuming.
    In exceptional cases, small master data tables ('APPL0', size category 0) can be buffered.
    The solution depends on the table content. If it is master or transaction data, the table should not be buffered. If the table content does not consist of master or transaction data, the data type should be corrected accordingly.
    This should answer your questions...
    Kind regards,
    Hermann

  • Ps query results to xml using xml link function registry

    In People tools version 8.46 we need something like where the ps query result output is in the form of XML so that it can be used for external system. The catch I cannot use webservices. It is something like opening peoplesoft queires form excel using hyperlink but in this case we need xml. I looked at David Vandiver's Excel XML libraries which open the data in excel but is there something where the hyperlink output is xml using xml link function registry. I have capatured the data in rowset and now need to create mime type of xml to write the data
    thanks in advance
    vinn

    If I understand correctly, you want to use something like Microsoft Excel's web queries to get data from a PeopleSoft query in XML format. I have never done this before, but if I were to implement this, here is what I would do in PT 8.46:
    1. Create an unstructured message in app designer.
    2. Create a user that only has access to the queries you want to expose to Excel
    3. Write synchronous message handler PeopleCode to call SwitchUser to switch to a specific query user rather than the generic integration broker user and execute a query, returning the results in XML (see [Query.RunToRowsest|http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tpcr/htm/tpcr31.htm#d0e113933] for an example).
    4. Call the message through IB using the HTTP GET URL format as defined in PeopleBooks: [http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tibr/book.htm?File=tibr/htm/tibr33.htm#H4026|http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tibr/book.htm?File=tibr/htm/tibr33.htm#H4026].

  • Use a package function inside a select of the same package

    Hi.
    How can i use a function defined inside a package, with a select used inside that same package ?
    Example
    ... package example
    CREATE OR REPLACE PACKAGE BODY pkg_example
    AS
         FUNCTION sum_two_values(p_val1 NUMBER,p_val2 NUMBER) RETURN NUMBER
         IS
         BEGIN
         RETURN p_val1 + p_val2;
         END sum_two_values;
         FUNCTION use_another_function_example RETURN VARCHAR2
         IS
         v_value NUMBER;
         BEGIN
         SELECT sum_two_values(2,2) INTO v_value FROM dual;
         RETURN 'waaaazzzzupppppp'
         END use_another_function_example;
    END pkg_example;
    This will not work
    -- SELECT sum_two_values(2,2) INTO v_value FROM dual;
    How can i call a function inside a select statement, a function of the same package where the query is being called.
    (i have Oracle 9.2x)
    Cheers.

    are you sure? you are not using package1, you are using pack1
    SQL> CREATE OR REPLACE PACKAGE package1
      2  IS
      3     FUNCTION f1
      4        RETURN NUMBER;
      5 
      6     FUNCTION f2
      7        RETURN NUMBER;
      8  END;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package1
      2  IS
      3     a   NUMBER;
      4 
      5     FUNCTION f1
      6        RETURN NUMBER
      7     IS
      8     BEGIN
      9        RETURN 1;
    10     END;
    11 
    12     FUNCTION f2
    13        RETURN NUMBER
    14     IS
    15     BEGIN
    16        SELECT package1.f1
    17          INTO a
    18          FROM DUAL;
    19 
    20        RETURN a;
    21     END;
    22  END;
    23  /
    Package body created.
    Why not just this
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PACKAGE BODY package1
      2  IS
      3     a   NUMBER;
      4     FUNCTION f1
      5        RETURN NUMBER
      6     IS
      7     BEGIN
      8        RETURN 1;
      9     END;
    10     FUNCTION f2
    11        RETURN NUMBER
    12     IS
    13     BEGIN
    14        a:= f1;
    15 RETURN a;
    16     END;
    17* END;
    SQL> /
    Package body created.formatted
    Message was edited by:
    devmiral

  • Performance issue with using out parameter sys_refcursor

    Hello,
    I'm using Oracle 10g, with ODP.Net in a C# application.
    I'm using about 10 stored procedures, each having one out parameter of sys_refcursor type. when I use one function in C# and call these 10 sp's, it takes about 78ms to excute the function.
    Now to improve the performance, I created one SP with 10 output parameters of sys_refcursor type. and i just call this one sp. the time taken has increased , not it takes abt 95ms.
    is this the right approach or how can we improve the performance by using sys_refcursor.
    please suggest, it is urgent, i'm stuck up with this issue.
    thanks
    shruti

    With 78ms and 95ms are you talking about milliseconds or minutes? If it's milliseconds then what's the problem and does it really matter if there is a difference of 17 milliseconds as that could just be caused by network traffic or something. If you're talking minutes, then we would need more information about what you are attempting to do, what tables and processing is going on, what indexes you have etc.
    Query optimisation tips can be found on this thread.. When your query takes too long ....
    Without more information we can't really tell what's happening.

  • Query time affected when using dimensions that are at a lower grain

    Hi all,
    I have a product dimension that has one hierarchy and 7 levels: All Product -> Category -> BU -> Class -> Department -> SubDept -> Item. The lowest level has about 8 million members. The Department level has about 1500 members
    Some of my Cubes are actually mapped to fact tables where the grain is at Department level. So I've ensured that in the Cube Mappings Editor, the Department Id of the fact table is mapped to the Department level of the Product Dimension, and I can actually see in the Cube's Aggmap, it is using LOAD_STATUS to limit the Product dimension to the Department level members for the aggregation.
    Querying the Cube using SQL brings back the correct result across different level combination, however the query constantly takes about 2 - 3 mins to complete.
    As a test, I've built another dimension that goes down to the Department level only, and issue the same query against the Cube. The difference is significant as the query takes roughly less than 1 second to complete, and returns exactly the same result.
    Any idea? I am using AWM 11.2.0.1.0A
    Thanks

    The stats you posted are puzzling. Usually the sum of loop and fetch time is close to the total time, but there is a big missing chunk of time in your case. It is clearly related to the calculated measures, since removing them solves the problem.
    The most common problem with calculated measures is that they can cause the cube to loop densely (i.e. all logical member combinations) instead of sparsely (i.e. only the member combinations that have data). But I don't think this is the problem in your case since the difference between rows_read and rows_returned is small
    ROWS_READ 212ROWS_RETURNED 185
    NULLTRACK_SUPPRESSED 27>
    If dense looping has happened then the rows_read is often orders of magnitude greater than rows_returned. You can see the looping strategy by running
    select value || ' : ' || details as loop from cube_operations_log where name = 'LOOP_OPTIMIZED'Here is an example of the output for a good (sparse) loop.
    LOOP
    ON : LOOP AGGMAP(PRICE_COST_CUBE_SOLVE_AGGMAP PRICE_COST_CUBE_PRT_TEMPLATE)Here is the output if I add a year to date calc to the cube.
    LOOP
    ON : LOOP UNION(AGGMAP(PRICE_COST_CUBE_SOLVE_AGGMAP PRICE_COST_CUBE_PRT_TEMPLATE
    ) AGGMAP(DENSE(TIME) PRICE_COST_CUBE_SOLVE_AGGMAP PRICE_COST_CUBE_PRT_TEMPLATE))Note that TIME is now looped densely, but the code is still trying to loop the other dimensions sparsely. Finally, here is the loop if I add a random olap dml calculation to the cube.
    LOOP
    DISABLED :There is now no optimized looping and the cube will be looped densely.
    So it may be worth checking the loop descriptor for your fast and slow cases, but my best guess at the moment is that the performance gap has something to do with your specific calculations. If I were you I would add them back one at a time to see if you can find a particular measure, or type of measure, that is causing the slowdown.

  • Query performance problem when using hierarchies

    Hello All,
    I've a query which is built on a hieracrhy with the following structure for eg.
    <b>A</b>
    |_<b>B</b>
    | |_L1
    |
    |_<b>C</b>
      |_L2
    When I restrict the query to hierarchy levels B and C simultaneously the query executes fine. But when i directly restrict the query to heirarchy level A , the query runs endlessly.
    Could some one please help me out as to why this is the case ?
    I don't have aggregates built on any of the hierarchy level.
    Best Regards,
    Sanjay

    Hi Roberto,
    thanks for your response. However, the problem is not solved even after applying the suggestions of the note 738098 :(. These queries used to execute fine until yesterday and there have been no major additions to the hierarchy. Please let me know if there is any thing else that can be done. We are planning to bounce the system and see if there are any performance improvements.
    PS: I've awarded points to you nevertheless, as the option suggested in the note seems useful and should be tried in case of these kind of performance issues
    Best Regards,
    Sanjay

  • Query performance difference with same script in two servers

    Dear all,
    I have problem with an INSERT Procedure. I have 2 servers, say Server A and Server B, In Server A the query execution will be finished in 4 minutes where in the Server B the same Query its taking more than 2 hours. 
    If I look into the execution plan in both servers, it looks different.
    Both have the Default Parallelism settings.
    Cost Threshold for Parallelism : 5
    Locks : 0
    Max Degree of Parallelism : 0
    Query Wait : -1
    What causing to slow down the process? Is the parallelism slowing down the process? 
    When I look into the SERVER A's active running processes in management studio, I found that there are 8 INSERT Queries running with only 2 RUNNABLE and 6 SUSPENDED. Anything is getting locked out or Waiting? 
    Please help and suggest my a solution for it. Thanks in advance.
    Regards,
    kranthi kumar G.

    Thanks Tony for your reply. Here are my answers.
    Are we talking a large amount of inserts?
    YES
    What is the autogrowth settings for the database files on the two Servers?
    Autogrowth by 10%
    The Server you are having an issue with, are the any triggers on the Tables?
    No.
    Is there a background or other trace running on the slow Server that could be impacting performance?
    Yes, we are running a monitoring tool to check the performance of the load.
    Is there another database on the slow Server causing issues?
    No.
    This could be a hardware issue; have you use perfmon to see if there are any disk queues?
    We will check with our DBA on this.
    What is the Raid Configuration?  Are the files on a single spindle?  If so what is the fragmentation state of any single spindle volume?
    There is no Rain Configuration. Its a Windows Azure A7.
    Are you automatically updating statistics on the slow Database?
    Yes.
    Is the Anti Virus Software on the Slow server scanning the data files?
    Yes, but not on the database level.
    Regards,
    kranthi.

  • Trouble with using javascript $s function to populate a page item

    Hello Oracle APEX Community,
    I'm working on a drilldown dashboard page and have been encountering a problem when i try to populate a Text Page Item (hidden or not) using the javascript built in $s function.
    The function works great when the data is a number such as dept_id (even if the field type is varchar). However, trying to pass anything which is a text the process fails, except when a value is hard-coded as a parameter for the function. So for example, I have a chart with counts of constituents by state. I would like to populate (filter) a table based on when you click on a bar for a state without having to submit the page. I'm using dynamic actions and a built in javascript function in the SQL for the chart to accomplish this; but again, it works great when I use a varchar field like the FIPS code (i.e. the FIPS for Texas is '48'), but when I try to populate the page item using the state abbreviation 'TX' (again varchar) it fails.
    Here's an example of code that works:
    SELECT 'javascript:$s("P1_DEPTNO",'||d.deptno||')' LINK,
    d.dname LABEL,
    sum(e.SAL) sal
    FROM emp e, dept d
    where e.deptno = d.deptno
    group by 'javascript:$s("P1_DEPTNO",'||d.deptno||')', d.dname And here's an example of code that does not work:
    SELECT 'javascript:$s("P1_DEPTNO",'||d.loc||')' LINK,
    d.dname LABEL,
    sum(e.SAL) sal
    FROM emp e, dept d
    where e.deptno = d.deptno
    group by 'javascript:$s("P1_DEPTNO",'||d.loc||')', d.dname However, when I hard code a text value the script works:
    SELECT 'javascript:$s("P1_DEPTNO","BOSTON")' LINK,
    d.dname LABEL,
    sum(e.SAL) sal
    FROM emp e, dept d
    where e.deptno = d.deptno
    group by 'javascript:$s("P1_DEPTNO","BOSTON")', d.dname
    ORDER BY d.dname I'm encountering this problem on several versions of APEX: (4.0.2.00.07-local installation) and (4.1.0.00.28-apex.oracle.com)
    Does anybody know of this problem and how to solve it? I've looked for settings on the page item itself, and can't figure it out.
    I've re-written my sql to utilize the value fields of my tables instead but I have some objects on the page which are really going to depend on the character based data instead.
    Thanks,
    Wayne

    In your javascript you are generating, surround your value with double-quotes and it'll should then always work with both numbers and strings (your strings are probably being interpreted as variable names and they don't exist at runtime, hence erroring out).
    Example:
    SELECT 'javascript:$s("P1_DEPTNO","'||d.loc||'")' LINK,Edited by: gti_matt on Aug 16, 2011 9:50 AM

Maybe you are looking for

  • HT4864 Large file stuck in iCloud

    I sent a file from my iPhone that is apparently too big for iCloud to handle and it is stuck in the outbox of my iPhone. I can not delete it. I tried and tried. Its been stuck about 6 hours now and it is drainking my battery. I also restarted my phon

  • AX 2012 management pack not showing any AX information

    1.     Symptom description: Ax 2012 management pack installed, detects machine and places them in the correct group but no AX specific monitoring happens.  IE Under 'Application Object Servers\Computers' I can see my AOS servers, but under 'Applicati

  • DV import - audio is out of sync 3 frames

    This never happened to me in FCP, so curious as to why audio is out of sync 3 frames... Footage is DV/NTSC 48K/16 bit, (footage is not shot w/this camera but) I am importing with my SONY hdr-hc7 (as usuall).  Thanks

  • Other ways to retrieve text on Droid

    we lost a phone and are waiting for another to come in.  in the meantime is there a way to get texts from online?

  • [svn:fx-trunk] 10445: We're stricter with styles now, so this was not compiling.

    Revision: 10445 Author:   [email protected] Date:     2009-09-20 18:59:55 -0700 (Sun, 20 Sep 2009) Log Message: We're stricter with styles now, so this was not compiling. Modified Paths:     flex/sdk/trunk/samples/ja_JP/explorer/core/SimpleApplicatio