Long running MDX-query

Table [Summary Requests] (count: 102 131):
Id Int primary key
RequesterFullNameId Int
Dimesion [Dm Requester Full Names] (count: 50 124):
Id Int primary key
Title VARCHAR(1000)
Dimesion [Dm Date] (count: 1 306):
FullDate DateTime первичный ключ
Year Int
1) Query execution lasts
5 seconds. Is it normal or not?
2) Аre there ways to reduce the query execution time?
Query example:
with
member [Measures].[XtraPivotGrid 1505778211 Sort] as '[Dm Date].[Year].currentmember.member_value'
member [Measures].[XtraPivotGrid 1025407302 Sort] as '[Measures].[Summary Requests Count]'
select
non empty { { [Dm Date].[Year].[All], { order({{[Dm Date].[Year].[Year].members}}, [Measures].[XtraPivotGrid 1505778211 Sort], asc)} }  * { [Measures].[Summary Requests Count]}} dimension properties MEMBER_UNIQUE_NAME,MEMBER_TYPE,MEMBER_VALUE  on
columns,
non empty { [Dm Requester Full Names].[Title].[All], { order({{[Dm Requester Full Names].[Title].[Title].members}}, [Measures].[XtraPivotGrid 1025407302 Sort], desc)} }
dimension properties MEMBER_UNIQUE_NAME,MEMBER_TYPE,MEMBER_VALUE  on rows
from [Elicense Reports]
where
( [Is Deleted].[Title].&[Нет] )

Hi Captainsir,
According to your description, the query execution lasts  5 seconds before return the results, and you want to know if it is normal or not, right?
In your query, you used CrossJoin function to join multiple dimensions which might cause the performance issue. If you cross-join medium-sized or large-sized sets (e.g., sets that contain more than 100 items each), you can end up with a result set that contains
many thousands of items—enough to seriously impair performance. For the detail information, please see:
http://sqlmag.com/data-access/cross-join-performance
Here is a blog which describe ways of improving MDX performance and improvements with MDX, please see:
http://blogs.msdn.com/b/azazr/archive/2008/05/01/ways-of-improving-mdx-performance-and-improvements-with-mdx-in-katmai-sql-2008.aspx
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • Running MDX Query in BEX

    I've a question regarding MDX Query .
    1.Can we run MDX Query in BEx.
    2.If yes , then can you please tell me how and where can we run MDX Query in BEx.
    Regards,
    -Neha

    Hello,
    BEx does not support MDX. You can use MDXTEST transaction to generate the MDX select statements against queries or infocubes but it cannot be used with BEx.
    Thanks,
    Michael

  • Running MDX query in oracle

    How do i run a mdx query in oracle. Do i need to install any extra component.
    I used the following query and i get an illegal symbol error...
    SELECT
    { [Measures].[sales] } on columns,
    {  [Date].[1998],[Date].[1999] } on rows
    From units_history_fact

    MDX is not supported by Oracle. If the given database uses Oracle OLAP then you can use the simba connector: http://www.simba.com/connectors/mdx-for-oracle-olap.

  • Run mdx query in batch

    Hi,
    I am using BW MDX Driver to report off SAP BW data. Sometimes the returned data may be too much according to user selection. My question is, is there any way to run the MDX query in batch, so that the data is not returned all at once?
    For opensql or infoset driver, we can configure the query to run in batch by adding some system environment variables. But for MDX, I have no idea now.
    Thanks,
    Ray

    Hi,
    Are you including the parameter that you must have created in Crystal Reports in the Select Expert. You need to include the parameter within the record selection or group selection formula of the Select Expert, as may be applicable. Only then the values returned by the database would be in accordance to the input by the user.
    For instance, let us assume that you have created the Country parameter in Crystal Reports. In order to return data as per input fed within the County parameter during Report Refresh, the formula in Select Expert would be somewhat like :
    {Customer.Country} = {?Country}
    Please do this preliminary check before thinking of using Open SQL or InfoSet driver instead of the MDX driver or feeding the environment variables through batch processing.
    Regards,
    Amogh.

  • Continue run MDX Query

    I want to execute a query which can continue run till 2 minutes .
    For Example- If I run below query, that should be run for 2 minutes with completion or Fail
    SELECT [Date].[Calendar Year].FirstChild on 0
    FROM [Adventure Works];
    Please Help
    -Ashish

    Hi David,
    This query hardly takes 2 second to complete. But I want that this should be continued  until it completes 2 minutes. Means - session of this query continue till 2 minutes instead it gets complete.
    Hi Ashishsingh,
    As Olaf said, we can use SQL. However, based on my research it seems there is no such a functionally to workaround this in MDX currently. If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that
    they can be, Microsoft might consider to add this feature in the following release after official confirmation.
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • MS SQL database needs to run mdx query to analysis services to retrieve data from a BPC 10 Netweaver cube(view only)

    We are in the process of migrating from BPC7 SP12 Microsoft sql server to BPC10 netweaver on a sql server with BW7.4 and need to integrate our home grown data warehouse which is on a Microsoft sql server.  The data warehouse currently connects to BPC7 using integration services/analysis services and runs mdx queries to analysis services to retrieve data from the BPC7 cube (view only).  Please provide documentation on how to create this same integration with our data warehouse using BPC10 netweaver on a sql server.

    When you were setting up your ODBC data source for
    the Text driver, did you click on the "Options"
    button? There's a lot of options in there that I
    didn't understand at first glance.Yes I clicked on the options button, but the only thing there is dealing with file extensions. I left it set to the default.
    I have since tried closing my connection after I insert a record, I then try executeQuery, but still no luck. Seems strange that I can write to the file but not read from it. If any thing I'd expect the opposite problem.
    I have also tried using the class "JoltReport" from the sun tutorial instead of my own with the same result.
    Message was edited by:
    Hentay

  • Long running process/query

    One of my after submit processes involves a lot of processing, temp tables, sorting, aggregating, etc.
    When this process is invoked from a page, is there a way to put up a generic 'Processing...' page that auto refreshes and when my back-end process is done, takes me to my results page?
    Thanks

    Let me see if I understand you...
    So, the first page (that would have invoked the long running process) branches to the "processing page". That page has a onload that does doSubmit(). The after submit process on this processing page calls my long running process via dbms_job. When the long running process ends, the branch on the processing page takes me back to the first page (or whereever).
    But then as far as the browser is concerned, the processing page never "finishes loading". IE's progress bar would creep ahead sloooowly and it would appear as if the page is loading for a looong time!
    Wouldnt it be cleaner to use the META refresh tag like John was suggesting?
    Also, using either of your approaches, how would I allow the user to "Cancel" the long running process and go back to the first page?
    Could you please put up a quick sample of this in action on htmldb.oracle.com?
    Thanks

  • Long running sql query

    All,
    I'm new for sql query tuning. My select sql query is running more than 5-6 hours to complete and it is using bind variable. I'm using OEM to monitor the query. I can see stats are upto date and no blocking sessions and no object locks in db level. Can anyone guide me where I have to look and what should be done to increase the performance?
    Thanks.

    Read FAQ: {message:id=9360003}
    And {message:id=9360002}

  • MDX Query not retuern any data on my production server when i check service it is running

    Hi All,
    MDX Query not return any data  on my production server when i check service it is running. when i restart my service  i can able to run MDX Query and get data in my production server.

    Hi Mnishcal,
    According to your description, there is no data returned before restart Analysis Services, right?
    We haven't experiencing such issue before. And we cannot reproduce this issue. In your scenario, can you reproduce this issue? Here is a post which explains why you might not see the data you expect when browsing a SQL Server Analysis Services cube that
    processed successfully. Please refer to the link below.
    http://social.technet.microsoft.com/wiki/contents/articles/19744.ssas-troubleshooting-data-is-not-visible-when-browsing-a-cube.aspx
    Besides, are there any error on the log file? The msmdsrv.log file for the SSAS instance that can be found in \log folder of the instance. (C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Log)
    Regards,
    Charlie Liao
    TechNet Community Support

  • Controlling meta data returned by an MDX query

    Hello,
    I'm retrieving results from Analysis Services then processing them further in SQL via OpenQuery. So I have a query of the form "select * from OpenQuery(LinkedServer, '<mdx>')
    The query works fine, but because I have a dimension hierarchy with a seven levels on rows, the result set contains seven columns which I don't need, one column for each level in the hierarchy.
    I can ignore them using the syntax "WITH CTE ([1],[2]...) as (<query>) ...", so this doesn't interfere with functionality.
    However, I'm wondering if there is some syntax in MDX which will prevent those columns from being returned at all. I'm guessing that regardless of whether they are selected in SQL, that data still has to be processed. The performance impact of this isn't
    noticeable on any single query, but it seems like for many queries with many rows it would add up. Is it possible to control the meta data that an MDX result set contains?
    Thank you!

    Hi vercinegetorix,
    When we run MDX query by using OPENQUERY having hierarchy, we will get extra columns describing the values of each hierarchy level in different columns. This behavior is by design and we can't change that.
    In addition, we may concern the attribute unique name a little long. The easiest way to remove them is to use an alias. For detail information, please refer to the article below:
    MDX + T-SQL: Combining relational and multi-dimensional data into one query result set:
    http://sqlblogcasts.com/blogs/drjohn/archive/2008/09/27/mdx-and-sql-combining-relational-and-multi-dimensional-data-into-one-query-result-set.aspx
    If you have any feedback on our support, please click
    here.
    Elvis Long
    TechNet Community Support

  • Cancel long running queries

    Hi Folks,
    Is it possible to submit a SELECT statment using OraSqlStmt object and retrieve the data so generated?
    I want to submit a long-running SELECT query against Oracle, and have the option to cancel the query.
    I can submit the query asynchronously NONBLK option of OraSqlStmt and then be able to cancel it. However, I also want to display the dataset returned by the query. But I think it is not possible to create a dataset / recordset or dynaset using OraSqlStmt.
    THe question is:
    How can I submit a long running Select query, be able to cancel it and if the query is not cancelled then be able to display the records in a grid? I am using VB6.
    Thanks

    Good news that this will be improved. Can't resist to post this Link: [plsql forum thread about start/stop.. | http://forums.oracle.com/forums/thread.jspa?forumID=75&threadID=927697]
    I have experienced the same and also noted that it feels better to execute stored procedures in sqldeveloper
    - by editing
    - compiling (might hang if already busy)
    - run from the same dialog just to get the the cylon's eye for emergency stops (which waits .... ) meanwhile jump to apex to fiddle with small table triggering exception to stop the procedure.
    If stored procedure is executed from the list via 'right mouse click'-style then you see in the log-region "connecting to databse ... ." but no method to stop nor cancel or cylon's eye is well hidden.
    When such "busy" is running I also noted that the database-connection right mouse click has greyed/inactivated the selections "connect/disconnect" so the next logical step for stopping via "disconnect" is out of the question.
    I think this also boils down also to question whether the user has rights to see gv$session and be able to drop/stop busy/jamming sessions. E.g. public synonyms listing has small icons with mystic red :)
    /paavo
    Java(TM) Platform     1.6.0_14
    Oracle IDE     1.5.4.59.40

  • Long running select statement and v$session_longops

    Oracle Version: 10.2.0.4
    I've a long running sql query that takes the estimated 6 minutes to complete and return the result.
    While it's running I'd like to observe it into the view v$session_longops.
    I altered the session that runs the query with
      ALTER SESSION SET timed_statistics=TRUE;The tables it queries have gathered statistics on them.
    However I don't see any rows in the view v$session_longops for the respective SID and serial#. Why is that? What am I missing?
    Thank you!

    Hi,
    Now I understand what you all meant by "loops" here .. Yes, the query does nested loops as one can see from the execution plan. So it could be the reason
    SELECT STATEMENT, GOAL = ALL_ROWS                                  
    SORT GROUP BY                                                             
      CONCATENATION                              
       TABLE ACCESS BY LOCAL INDEX ROWID     TABLE_1
        NESTED LOOPS                                                   
         NESTED LOOPS
          TABLE ACCESS BY GLOBAL INDEX ROWID     TABLE_2      
           INDEX RANGE SCAN                           IPK_t2_CDATE                               
          TABLE ACCESS BY INDEX ROWID     TABLE_3
           INDEX RANGE SCAN                     IPK_T3                            
         PARTITION RANGE ALL                                                 
          INDEX RANGE SCAN     IRGP_REGCODE                        
       TABLE ACCESS BY LOCAL INDEX ROWID     TABLE_1
        NESTED LOOPS                                                  
         NESTED LOOPS          
          TABLE ACCESS BY GLOBAL INDEX ROWID     TABLE_2     
           INDEX RANGE SCAN                       IPK_t2_STATUS          
          TABLE ACCESS BY INDEX ROWID     TABLE_3     
           INDEX RANGE SCAN                       IPK_T3
         PARTITION RANGE SINGLE               
          INDEX RANGE SCAN                     IRGP_REGCODE          

  • MDX query runs on SQL but does not populate 'Measures' in Powerpivot

    I ran MDX query on SQL 2012 for looking the products and their shipping status
    The code is given below:
    WITH 
    set Date1 AS 
         strtomember( "[Time].[2014].[Q4].[2014-Jun].[" +format(now()-2, "MM") + "/"+format(now()-2, "dd") + "/" +format(now()-2, "yyyy") + "]")
    set Item1 as
    { [Item].[ItemID].ALLMEMBERS}
    SELECT NON EMPTY { [Measures].[Shipped Qty], [Measures].[Shipped Amt], [Measures].[Ordered Qty], [Measures].[Ordered Amt] }
    ON COLUMNS, 
    Date1*[Item1] ON ROWS FROM [ABCD]
     WHERE ( 
                 [Channel].&[OL], 
                 [Geography].&[A.9])
    The query gives desired output when run in SQL. But when I run the same query in while pulling data in PowerPivot, Dimensions i.e. Date and Item are populated but measures were not populated. Can anyone please help me understand how to populated Measures
    in PowerPivot?
     

    Hi apoorv,
    It was hard to reproduce this issue on my test environment. I would suggest you try to use a simple MDX query to check if it will retrun the correct measures data. Please see the screenshot below:
    In addition, you can also create a SQL Server Analysis Services trace to capture some events for furhter investigation.
    Use SQL Server Profiler to Monitor Analysis Services:http://technet.microsoft.com/en-us/library/ms174946.aspx
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • Long running query--- included steps given by Randolf

    Hi,
    I have done my best to follow Randolf instruction word-by-word and hope to get solution for my
    problem soon. Sometime back I have posted a thread on this problem then got busy with other
    stuff and was not able to follow it. Here I am again with same issue.
    here is link for my previous post
    long running query in database 10gHere is backgroud of my requriemment.
    I am working on Oracle forms 10g which is using package given below. We want to display client information
    with order count basd on different status like Pending, Error, back Order, expedited, std shipping.
    Output will look something like.
    client name   pending    error   backorder   expedited   std shipping
    ABC            24         0       674          6789         78900
    XYZ            35         673    5700           0           798274
    .There are total 40 clients . The long running query are expedited and std shipping.
    When i run package from Oracle Form Developer it takes 3 mintues to run but when I run same query in our application using forms
    (which uses Oracle Application Server) it takes around 1 hour, which is completly unacceptable.
    User wants it be done in less than 1 mintue.
    I have tried combining Pending,error and backorder queries together but as far as I know it will not
    work in Oracle Form as we need a place holder for each status.
    Please dont think it is Forms related question, it is a Performance problem.
    PACKAGE BODY ORDER_COUNT_PKG IS
    PROCEDURE post_query IS
      BEGIN
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.PENDING
                  FROM orders o
              WHERE o.status = 'P'
                   AND (parent_order_id is null
                    OR  (order_type='G'
                         AND parent_order_id=original_order_number))
                      AND  o.client = :ORDER_STATUS.CLIENT_NUMBER;
         EXCEPTION
           WHEN OTHERS THEN
           NULL;
           END;
             BEGIN
                 SELECT  count(*)
                   INTO  :ORDER_STATUS.ERROR
                   FROM  orders o
                  WHERE  o.status = 'E'
                    AND  (parent_order_id is null
                     OR  (order_type='G'
                           AND parent_order_id=original_order_number))
                       AND  o.client = :ORDER_STATUS.CLIENT_NUMBER;
                EXCEPTION
           WHEN OTHERS THEN
           NULL;     
            END;
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.BACK_ORDER
                  FROM orders o
              WHERE o.status = 'B'
                   AND (parent_order_id is null
                    OR (order_type='G'
                         AND parent_order_id=original_order_number))
                      AND o.client = :ORDER_STATUS.CLIENT_NUMBER;
          EXCEPTION
           WHEN OTHERS THEN
           NULL;   
         END;
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.EXPEDITE
                  FROM orders o,shipment_type_methods stm
                 WHERE o.status in ('A','U')
             AND (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND (nvl(o.priority,'1') = '2'
              OR  stm.surcharge_amount <> 0)
                      AND  o.client = :ORDER_STATUS.CLIENT_NUMBER
              GROUP BY  o.client;
              EXCEPTION
           WHEN OTHERS THEN
           NULL;          
         END;           
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.STD_SHIP
                  FROM  orders o,shipment_type_methods stm
                 WHERE o.status in ('A','U')
             AND  (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND nvl(o.priority,'1') <> '2'
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND stm.surcharge_amount = 0
                      AND o.client = :ORDER_STATUS.CLIENT_NUMBER
              GROUP BY o.client;
          EXCEPTION
           WHEN OTHERS THEN
           NULL;
           END;
      END post_query;
      END ORDER_COUNT_PKG;one of the query which is taking long time is
    SELECT count(*)
                   FROM  orders o,shipment_type_methods stm
                 WHERE o.status in ('A','U')
             AND  (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND nvl(o.priority,'1') <> '2'
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND stm.surcharge_amount = 0
               AND o.client = :CLIENT_NUMBER
              GROUP BY o.clientThe version of the database is 10.2.1.0.2
    SQL> alter session force parallel dml;These are the parameters relevant to the optimizer:
    SQL> show parameter user_dump_dest
    NAME                                 TYPE        VALUE
    user_dump_dest                       string      /u01/app/oracle/admin/mcgemqa/
                                                     udump
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.4
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     16
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACTHere is the output of EXPLAIN PLAN:
    SQL> explain plan for
      2  SELECT count(*)
      3         FROM  orders o,shipment_type_methods stm
      4       WHERE o.status in ('A','U')
      5           AND  (o.parent_order_id is null
      6            OR (o.order_type = 'G'
      7           AND o.parent_order_id = o.original_order_number))
      8           AND nvl(o.priority,'1') <> '2'
      9           AND o.client = stm.client
    10           AND o.shipment_class_code = stm.shipment_class_code
    11           AND stm.surcharge_amount = 0
    12     AND o.client = :CLIENT_NUMBER
    13    GROUP BY o.client
    14  /
    Explained.
    Elapsed: 00:00:00.12
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    24 rows selected.
    Elapsed: 00:00:00.86
    SQL> rollback;
    Rollback complete.
    Elapsed: 00:00:00.07Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> SELECT count(*)
      2         FROM  orders o,shipment_type_methods stm
      3       WHERE o.status in ('A','U')
      4           AND  (o.parent_order_id is null
      5            OR (o.order_type = 'G'
      6           AND o.parent_order_id = o.original_order_number))
      7           AND nvl(o.priority,'1') <> '2'
      8           AND o.client = stm.client
      9           AND o.shipment_class_code = stm.shipment_class_code
    10           AND stm.surcharge_amount = 0
    11     AND o.client = :CLIENT_NUMBER
    12    GROUP BY o.client
    13  /
    Elapsed: 00:00:03.09
    Execution Plan
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    Statistics
             55  recursive calls
              0  db block gets
           7045  consistent gets
              0  physical reads
              0  redo size
            206  bytes sent via SQL*Net to client
            238  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> The TKPROF output for this statement looks like the following:
    SELECT count(*)
           FROM  orders o,shipment_type_methods stm
         WHERE o.status in ('A','U')
             AND  (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND nvl(o.priority,'1') <> '2'
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND stm.surcharge_amount = 0
       AND o.client = :CLIENT_NUMBER
      GROUP BY o.client
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.04       0.04          0          0          0           0
    Fetch        2      2.96       2.91          0       7039          0           1
    total        4      3.01       2.95          0       7039          0           1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 95 
    Rows     Row Source Operation
          1  SORT GROUP BY NOSORT (cr=7039 pr=0 pw=0 time=2913701 us)
         91   TABLE ACCESS BY INDEX ROWID ORDERS (cr=7039 pr=0 pw=0 time=261997906 us)
         93    NESTED LOOPS  (cr=6976 pr=0 pw=0 time=20740 us)
          1     TABLE ACCESS BY INDEX ROWID SHIPMENT_TYPE_METHODS (cr=2 pr=0 pw=0 time=208 us)
          3      INDEX RANGE SCAN U_SHIPMENT_TYPE_METHODS (cr=1 pr=0 pw=0 time=88 us)(object id 81957)
         91     INDEX RANGE SCAN ORDERS_ORDER_DATE (cr=6974 pr=0 pw=0 time=70 us)(object id 81547)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2        0.02          0.02
    ********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> variable CLIENT_NUMBER varchar2(20)
    SQL> exec :CLIENT_NUMBER := '14'
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.06
    SQL> SELECT /*+ gather_plan_statistics */ count(*)
      2         FROM  orders o,shipment_type_methods stm
      3       WHERE o.status in ('A','U')
      4           AND  (o.parent_order_id is null
      5            OR (o.order_type = 'G'
      6           AND o.parent_order_id = o.original_order_number))
      7           AND nvl(o.priority,'1') <> '2'
      8           AND o.client = stm.client
      9           AND o.shipment_class_code = stm.shipment_class_code
    10           AND stm.surcharge_amount = 0
    11     AND o.client = :CLIENT_NUMBER
    12    GROUP BY o.client
    13  /
      COUNT(*)
            91
    Elapsed: 00:00:02.85
    SQL> set termout on
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  4nfj368y8w6a3, child number 0
    SELECT /*+ gather_plan_statistics */ count(*)        FROM  orders o,shipment_type_methods stm      WHERE
    o.status in ('A','U')          AND  (o.parent_order_id is null           OR (o.order_type = 'G'
    AND o.parent_order_id = o.original_order_number))          AND nvl(o.priority,'1') <> '2'          AND
    o.client = stm.client          AND o.shipment_class_code = stm.shipment_class_code          AND
    stm.surcharge_amount = 0    AND o.client = :CLIENT_NUMBER   GROUP BY o.client
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |   1 |  SORT GROUP BY NOSORT          |                         |      1 |      1 |      1 |00:00:02.63 |    7039 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |      1 |    175K|     91 |00:03:56.87 |    7039 |
    |   3 |    NESTED LOOPS                |                         |      1 |  25300 |     93 |00:00:00.02 |    6976 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |      1 |      1 |      1 |00:00:00.01 |       2 |
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |      1 |      2 |      3 |00:00:00.01 |       1 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |      1 |    176K|     91 |00:00:00.01 |    6974 |
    Predicate Information (identified by operation id):
       2 - filter((("O"."PARENT_ORDER_ID" IS NULL OR ("O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER"))) AND NVL("O"."PRIORITY",'1')<>'
                  "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE"))
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter(("O"."STATUS"='A' OR "O"."STATUS"='U'))
    32 rows selected.
    Elapsed: 00:00:01.30
    SQL> I'm looking forward for suggestions how to improve the performance of this statement.
    Thanks
    Sandy

    Please find explain plan for No hint
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    24 rows selected.
    Elapsed: 00:00:00.86Explain Plan for Parallel Hint
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"='14')
       6 - access("O"."CLIENT"='14')
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    24 rows selected.
    Elapsed: 00:00:08.92Explain Plan for USE_Hash hint
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1465232248
    | Id  | Operation                     | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                         |     1 |    35 | 46786   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT         |                         |     1 |    35 | 46786   (3)| 00:09:22 |
    |*  2 |   HASH JOIN                   |                         | 25300 |   864K| 46786   (3)| 00:09:22 |
    |*  3 |    TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00:0
    |*  4 |     INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  5 |    TABLE ACCESS BY INDEX ROWID| ORDERS                  |   175K|  3431K| 46763   (3)| 00:09:22 |
    |*  6 |     INDEX RANGE SCAN          | ORDERS_ORDER_DATE       |   176K|       |  4268   (8)| 00:00:52 |
    Predicate Information (identified by operation id):
       2 - access("O"."CLIENT"="STM"."CLIENT" AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_COD
                  E")
       3 - filter("STM"."SURCHARGE_AMOUNT"=0)
       4 - access("STM"."CLIENT"='14')
       5 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
       6 - access("O"."CLIENT"='14')
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    25 rows selected.
    Elapsed: 00:00:01.09
    SQL> Thanks
    Sandy

  • Getting the MDX query select error when running a webi report on BI query

    Getting the following error when running a webi report on BI query :
    A database error occured. The database error text is: The MDX query SELECT  { [Measures].[D8JBFK099LLUVNLO7JY49FJKU] }  ON COLUMNS , NON EMPTY [ZCOMPCODE].[LEVEL01].MEMBERS ON ROWS FROM [ZTEST_CUB/REP_20100723200521]  failed to execute with the error Unknown error. (WIS 10901).
    I have gone through many threads related to this error. But not able find the steps to follow for resoultion.
    Please help in this regard.
    Thanks,
    Jeethender

    The Fix Pack is also for Client Tools--it is a separate download.  Please see the text below for ADAPT01255422
    ADAPT01255422
    Description:
    Web Intelligence generates an incorrect MDX statement when a characteristic and a prompt are used.
    The following database error happens: "The MDX query ... failed to execute with the error
    Unknown error (WIS 10901)."
    New Behavior:
    This problem is resolved.
    This information is also available in the Fixed Issues document for any Fix Pack greater than 2.2.

Maybe you are looking for

  • I am just new to Mac computer, I can't open a webpage in safari, I don't even see the address bar

    Help guys....I can't see the address bar in safari....I am new to Mac and

  • SP18 effect on Web Dynpro controls?

    Hey All, Does anyone know if SP18 made any changes to any of the Web Dynpro controls? We recently went to SP18 and are now seeing some very odd things happening. Just to narrow down where the problem might be, just wanted to see if there are any know

  • Delays in my SWF Playback

    Flash Wizards Help! I just finished working on a 12 minute animation in Flash (after only 4 years). The cartoon has sounds and music contained within it. Whenever I quick-preview the film in Flash (through SWF -command/return), everything lines up pe

  • Can someone tell me if there's a problem with my recursive file search?

    I've been trying to get a recursive file search working. I wanted to go through each directory and add every file to a database so I can use extremely fast, advanced file searches through my program. I wrote up this code <CODE> package myrecursive; i

  • When is the fan supposed to rev?

    I'm having some difficulties with my newish (November) G5 and I need to start breaking them down. Question one: Does anyone know when the G5's fan is supposed to rev up? Mine seems to do so on at least two occasions--when it is asked to or decides it