Query accessing SSAS cube is taking more time in power view report

Hi,
My SSAS server is having 16 Core's . I have created a power view in sharepoint site, which is accessing ssas cube.
The report is taking more time to show the result.  I traced the DAX query using SQL Server profiler. When I ran this DAX query in SSAS server directly, then its taking less time but when the same query running from sharepoint server (power view) , it
is taking more time. Number of records in the fact table is 300M . 
Also i tracked the %process time in performance monitor, mostly the line is below 20%. I think the CPU is not fully utilized..
Could you please help me to improve the performance of my report.
Regards,
Arun

Hi Arun,
According to your description, you create a PowerView report in SharePoint site connect to SSAS cube, the problem is that it take long time to show the result in the report, now you want to improve report performance, right?
In your scenario, you said that it takes more time to return the result in PowerView report than run the query directly in SSMS. For a report, its run time contain retrieval data time and render report time. So it takes more time to return the result in
PowerView report than run the query directly in SSMS. And there are 300M records in the fact table, the performance can be caused by large data. Here is a blog which describes tracks down Power View performance problems.
http://blogs.msdn.com/b/psssql/archive/2013/07/29/tracking-down-power-view-performance-problems.aspx
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • Table access by index rowid taking more time

    Hi All
    I've a query like
    update tab1
      set col1 = ( select col2 from
                           tab2 
                    where tab1.id = tab2.id) table 1 has arnd 10,000 rows
    table 2 has arnd 1,700,000 rows and has a primay key on column id.
    This query is taking around 20 secs to execute. I checked the xplan and most of time taken for table access by index rowid.
    Could you please suggest what can be the reason for this. (Can it be the clustering factor or something else)
    I checked the stats for the tab2, its just three days old.
    Regards
    Ashwani

    >
    table 1 has arnd 10,000 rows
    table 2 has arnd 1,700,000 rows and has a primay key on column id.
    This query is taking around 20 secs to execute. I checked the xplan and most of time taken for table access by index rowid.
    Could you please suggest what can be the reason for this. (Can it be the clustering factor or something else)
    I checked the stats for the tab2, its just three days old.
    >
    If you checked the xplan why haven't you posted it so we can look at it? Then we could see what table is being accessed by index rowid. Presumably it is table 2 but we the plan would eliminate the need to make assumptions.
    The clustering factor could be a factor. You haven't told us how table1 is being accessed. All rows are being updated so a full table scann is most likely but again the plan would actually show the access.
    Did you query the dictionary to see what the clustering factor is? Post the results of that
    SQL> select index_name, leaf_blocks, avg_leaf_blocks_per_key, avg_data_blocks_per_key, clustering_factor, distinct_keys
    2 from dba_indexes
    3 where owner = 'schema'
    4 and index_name in ('index_b','index_a');

  • InfoObject Help taking more time in BI web report Input screen

    Hi all,
    i am having a report consist of 3 variables .So, when ever i will execute it, variable screen will pop up.
    Now, There is an object name as "Master Location" , and it is having variable .
    Now, the problem is when i click on the help of Master Location , it will take 15-20 minutes to open the help window.
    "Master Location" is the navigational attribute of the Object "Location".
    Also, If i will not select the help button on the initial screen and directly executes the query and if i will open the Filter value screen for Master Location , it will open the same help window within the 3 sec.
    Please suggest .
    Regards,
    Macwan James.

    Hi,
      This is usually due to some backend select statement failure ie due to inconsistencies in master data. Sometimes if you run RSRV you can fix the issue. At the worst case if you can clean up the master data and load them newly you will get this issue fixed. We have faced this where the selection screen never returned a value and clean up of master data helped us in fixing the issue.
    Hope this helps.
    Thanks,
    Arun

  • No more Count (distinct) : Power View in Excel 2013

    Hello,
    I used to create a Power View report using this field "Sport" where I choose
     Count (Distinct)
    Today this option is not available in the drop down menu. What did I miss?
    Thanks

    Hi,
    The issue may be caused the "Sport filed" is modified or it is converted from a text (non-numeric) field to a measure. It shows the "Count" option, please see the
    article. We may try to remove the filed and re-add the filed to the field list.
    If you want to know more about "based Power View Reports", we can download a sample with the below link and test the steps.
    http://office.microsoft.com/en-us/excel-help/tutorial-create-map-based-power-view-reports-HA104075403.aspx
    Regards,
    George Zhao
    TechNet Community Support

  • Query in timesten taking more time than query in oracle database

    Hi,
    Can anyone please explain me why query in timesten taking more time
    than query in oracle database.
    I am mentioning in detail what are my settings and what have I done
    step by step.........
    1.This is the table I created in Oracle datababase
    (Oracle Database 10g Enterprise Edition Release 10.2.0.1.0)...
    CREATE TABLE student (
    id NUMBER(9) primary keY ,
    first_name VARCHAR2(10),
    last_name VARCHAR2(10)
    2.THIS IS THE ANONYMOUS BLOCK I USE TO
    POPULATE THE STUDENT TABLE(TOTAL 2599999 ROWS)...
    declare
    firstname varchar2(12);
    lastname varchar2(12);
    catt number(9);
    begin
    for cntr in 1..2599999 loop
    firstname:=(cntr+8)||'f';
    lastname:=(cntr+2)||'l';
    if cntr like '%9999' then
    dbms_output.put_line(cntr);
    end if;
    insert into student values(cntr,firstname, lastname);
    end loop;
    end;
    3. MY DSN IS SET THE FOLLWING WAY..
    DATA STORE PATH- G:\dipesh3repo\db
    LOG DIRECTORY- G:\dipesh3repo\log
    PERM DATA SIZE-1000
    TEMP DATA SIZE-1000
    MY TIMESTEN VERSION-
    C:\Documents and Settings\dipesh>ttversion
    TimesTen Release 7.0.3.0.0 (32 bit NT) (tt70_32:17000) 2007-09-19T16:04:16Z
    Instance admin: dipesh
    Instance home directory: G:\TimestTen\TT70_32
    Daemon home directory: G:\TimestTen\TT70_32\srv\info
    THEN I CONNECT TO THE TIMESTEN DATABASE
    C:\Documents and Settings\dipesh> ttisql
    command>connect "dsn=dipesh3;oraclepwd=tiger";
    4. THEN I START THE AGENT
    call ttCacheUidPwdSet('SCOTT','TIGER');
    Command> CALL ttCacheStart();
    5.THEN I CREATE THE READ ONLY CACHE GROUP AND LOAD IT
    create readonly cache group rc_student autorefresh
    interval 5 seconds from student
    (id int not null primary key, first_name varchar2(10), last_name varchar2(10));
    load cache group rc_student commit every 100 rows;
    6.NOW I CAN ACCESS THE TABLES FROM TIMESTEN AND PERFORM THE QUERY
    I SET THE TIMING..
    command>TIMING 1;
    consider this query now..
    Command> select * from student where first_name='2155666f';
    < 2155658, 2155666f, 2155660l >
    1 row found.
    Execution time (SQLExecute + Fetch Loop) = 0.668822 seconds.
    another query-
    Command> SELECT * FROM STUDENTS WHERE FIRST_NAME='2340009f';
    2206: Table SCOTT.STUDENTS not found
    Execution time (SQLPrepare) = 0.074964 seconds.
    The command failed.
    Command> SELECT * FROM STUDENT where first_name='2093434f';
    < 2093426, 2093434f, 2093428l >
    1 row found.
    Execution time (SQLExecute + Fetch Loop) = 0.585897 seconds.
    Command>
    7.NOW I PERFORM THE SIMILAR QUERIES FROM SQLPLUS...
    SQL> SELECT * FROM STUDENT WHERE FIRST_NAME='1498671f';
    ID FIRST_NAME LAST_NAME
    1498663 1498671f 1498665l
    Elapsed: 00:00:00.15
    Can anyone please explain me why query in timesten taking more time
    that query in oracle database.
    Message was edited by: Dipesh Majumdar
    user542575
    Message was edited by:
    user542575

    TimesTen
    Hardware: Windows Server 2003 R2 Enterprise x64; 8 x Dual-core AMD 8216 2.41GHz processors; 32 GB RAM
    Version: 7.0.4.0.0 64 bit
    Schema:
    create usermanaged cache group factCache from
    MV_US_DATAMART
    ORDER_DATE               DATE,
    IF_SYSTEM               VARCHAR2(32) NOT NULL,
    GROUPING_ID                TT_BIGINT,
    TIME_DIM_ID               TT_INTEGER NOT NULL,
    BUSINESS_DIM_ID          TT_INTEGER NOT NULL,
    ACCOUNT_DIM_ID               TT_INTEGER NOT NULL,
    ORDERTYPE_DIM_ID          TT_INTEGER NOT NULL,
    INSTR_DIM_ID               TT_INTEGER NOT NULL,
    EXECUTION_DIM_ID          TT_INTEGER NOT NULL,
    EXEC_EXCHANGE_DIM_ID TT_INTEGER NOT NULL,
    NO_ORDERS               TT_BIGINT,
    FILLED_QUANTITY          TT_BIGINT,
    CNT_FILLED_QUANTITY          TT_BIGINT,
    QUANTITY               TT_BIGINT,
    CNT_QUANTITY               TT_BIGINT,
    COMMISSION               BINARY_FLOAT,
    CNT_COMMISSION               TT_BIGINT,
    FILLS_NUMBER               TT_BIGINT,
    CNT_FILLS_NUMBER          TT_BIGINT,
    AGGRESSIVE_FILLS          TT_BIGINT,
    CNT_AGGRESSIVE_FILLS          TT_BIGINT,
    NOTIONAL               BINARY_FLOAT,
    CNT_NOTIONAL               TT_BIGINT,
    TOTAL_PRICE               BINARY_FLOAT,
    CNT_TOTAL_PRICE          TT_BIGINT,
    CANCELLED_ORDERS_COUNT          TT_BIGINT,
    CNT_CANCELLED_ORDERS_COUNT     TT_BIGINT,
    ROUTED_ORDERS_NO          TT_BIGINT,
    CNT_ROUTED_ORDERS_NO          TT_BIGINT,
    ROUTED_LIQUIDITY_QTY          TT_BIGINT,
    CNT_ROUTED_LIQUIDITY_QTY     TT_BIGINT,
    REMOVED_LIQUIDITY_QTY          TT_BIGINT,
    CNT_REMOVED_LIQUIDITY_QTY     TT_BIGINT,
    ADDED_LIQUIDITY_QTY          TT_BIGINT,
    CNT_ADDED_LIQUIDITY_QTY     TT_BIGINT,
    AGENT_CHARGES               BINARY_FLOAT,
    CNT_AGENT_CHARGES          TT_BIGINT,
    CLEARING_CHARGES          BINARY_FLOAT,
    CNT_CLEARING_CHARGES          TT_BIGINT,
    EXECUTION_CHARGES          BINARY_FLOAT,
    CNT_EXECUTION_CHARGES          TT_BIGINT,
    TRANSACTION_CHARGES          BINARY_FLOAT,
    CNT_TRANSACTION_CHARGES     TT_BIGINT,
    ORDER_MANAGEMENT          BINARY_FLOAT,
    CNT_ORDER_MANAGEMENT          TT_BIGINT,
    SETTLEMENT_CHARGES          BINARY_FLOAT,
    CNT_SETTLEMENT_CHARGES          TT_BIGINT,
    RECOVERED_AGENT          BINARY_FLOAT,
    CNT_RECOVERED_AGENT          TT_BIGINT,
    RECOVERED_CLEARING          BINARY_FLOAT,
    CNT_RECOVERED_CLEARING          TT_BIGINT,
    RECOVERED_EXECUTION          BINARY_FLOAT,
    CNT_RECOVERED_EXECUTION     TT_BIGINT,
    RECOVERED_TRANSACTION          BINARY_FLOAT,
    CNT_RECOVERED_TRANSACTION     TT_BIGINT,
    RECOVERED_ORD_MGT          BINARY_FLOAT,
    CNT_RECOVERED_ORD_MGT          TT_BIGINT,
    RECOVERED_SETTLEMENT          BINARY_FLOAT,
    CNT_RECOVERED_SETTLEMENT     TT_BIGINT,
    CLIENT_AGENT               BINARY_FLOAT,
    CNT_CLIENT_AGENT          TT_BIGINT,
    CLIENT_ORDER_MGT          BINARY_FLOAT,
    CNT_CLIENT_ORDER_MGT          TT_BIGINT,
    CLIENT_EXEC               BINARY_FLOAT,
    CNT_CLIENT_EXEC          TT_BIGINT,
    CLIENT_TRANS               BINARY_FLOAT,
    CNT_CLIENT_TRANS          TT_BIGINT,
    CLIENT_CLEARING          BINARY_FLOAT,
    CNT_CLIENT_CLEARING          TT_BIGINT,
    CLIENT_SETTLE               BINARY_FLOAT,
    CNT_CLIENT_SETTLE          TT_BIGINT,
    CHARGEABLE_TAXES          BINARY_FLOAT,
    CNT_CHARGEABLE_TAXES          TT_BIGINT,
    VENDOR_CHARGE               BINARY_FLOAT,
    CNT_VENDOR_CHARGE          TT_BIGINT,
    ROUTING_CHARGES          BINARY_FLOAT,
    CNT_ROUTING_CHARGES          TT_BIGINT,
    RECOVERED_ROUTING          BINARY_FLOAT,
    CNT_RECOVERED_ROUTING          TT_BIGINT,
    CLIENT_ROUTING               BINARY_FLOAT,
    CNT_CLIENT_ROUTING          TT_BIGINT,
    TICKET_CHARGES               BINARY_FLOAT,
    CNT_TICKET_CHARGES          TT_BIGINT,
    RECOVERED_TICKET_CHARGES     BINARY_FLOAT,
    CNT_RECOVERED_TICKET_CHARGES     TT_BIGINT,
    PRIMARY KEY(ORDER_DATE, TIME_DIM_ID, BUSINESS_DIM_ID, ACCOUNT_DIM_ID, ORDERTYPE_DIM_ID, INSTR_DIM_ID, EXECUTION_DIM_ID,EXEC_EXCHANGE_DIM_ID),
    READONLY);
    No of rows: 2228558
    Config:
    < CkptFrequency, 600 >
    < CkptLogVolume, 0 >
    < CkptRate, 0 >
    < ConnectionCharacterSet, US7ASCII >
    < ConnectionName, tt_us_dma >
    < Connections, 64 >
    < DataBaseCharacterSet, AL32UTF8 >
    < DataStore, e:\andrew\datacache\usDMA >
    < DurableCommits, 0 >
    < GroupRestrict, <NULL> >
    < LockLevel, 0 >
    < LockWait, 10 >
    < LogBuffSize, 65536 >
    < LogDir, e:\andrew\datacache\ >
    < LogFileSize, 64 >
    < LogFlushMethod, 1 >
    < LogPurge, 0 >
    < Logging, 1 >
    < MemoryLock, 0 >
    < NLS_LENGTH_SEMANTICS, BYTE >
    < NLS_NCHAR_CONV_EXCP, 0 >
    < NLS_SORT, BINARY >
    < OracleID, NYCATP1 >
    < PassThrough, 0 >
    < PermSize, 4000 >
    < PermWarnThreshold, 90 >
    < PrivateCommands, 0 >
    < Preallocate, 0 >
    < QueryThreshold, 0 >
    < RACCallback, 0 >
    < SQLQueryTimeout, 0 >
    < TempSize, 514 >
    < TempWarnThreshold, 90 >
    < Temporary, 1 >
    < TransparentLoad, 0 >
    < TypeMode, 0 >
    < UID, OS_OWNER >
    ORACLE:
    Hardware: Sunos 5.10; 24x1.8Ghz (unsure of type); 82 GB RAM
    Version 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    Schema:
    CREATE MATERIALIZED VIEW OS_OWNER.MV_US_DATAMART
    TABLESPACE TS_OS
    PARTITION BY RANGE (ORDER_DATE)
    PARTITION MV_US_DATAMART_MINVAL VALUES LESS THAN (TO_DATE(' 2007-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_NOV_D1 VALUES LESS THAN (TO_DATE(' 2007-11-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_NOV_D2 VALUES LESS THAN (TO_DATE(' 2007-11-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_NOV_D3 VALUES LESS THAN (TO_DATE(' 2007-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_DEC_D1 VALUES LESS THAN (TO_DATE(' 2007-12-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_DEC_D2 VALUES LESS THAN (TO_DATE(' 2007-12-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_07_DEC_D3 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_08_JAN_D1 VALUES LESS THAN (TO_DATE(' 2008-01-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_08_JAN_D2 VALUES LESS THAN (TO_DATE(' 2008-01-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_08_JAN_D3 VALUES LESS THAN (TO_DATE(' 2008-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS,
    PARTITION MV_US_DATAMART_MAXVAL VALUES LESS THAN (MAXVALUE)
    LOGGING
    NOCOMPRESS
    TABLESPACE TS_OS
    NOCACHE
    NOCOMPRESS
    NOPARALLEL
    BUILD DEFERRED
    USING INDEX
    TABLESPACE TS_OS_INDEX
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    ENABLE QUERY REWRITE
    AS
    SELECT order_date, if_system,
    GROUPING_ID (order_date,
    if_system,
    business_dim_id,
    time_dim_id,
    account_dim_id,
    ordertype_dim_id,
    instr_dim_id,
    execution_dim_id,
    exec_exchange_dim_id
    ) GROUPING_ID,
    /* ============ DIMENSIONS ============ */
    time_dim_id, business_dim_id, account_dim_id, ordertype_dim_id,
    instr_dim_id, execution_dim_id, exec_exchange_dim_id,
    /* ============ MEASURES ============ */
    -- o.FX_RATE /* FX_RATE */,
    COUNT (*) no_orders,
    -- SUM(NO_ORDERS) NO_ORDERS,
    -- COUNT(NO_ORDERS) CNT_NO_ORDERS,
    SUM (filled_quantity) filled_quantity,
    COUNT (filled_quantity) cnt_filled_quantity, SUM (quantity) quantity,
    COUNT (quantity) cnt_quantity, SUM (commission) commission,
    COUNT (commission) cnt_commission, SUM (fills_number) fills_number,
    COUNT (fills_number) cnt_fills_number,
    SUM (aggressive_fills) aggressive_fills,
    COUNT (aggressive_fills) cnt_aggressive_fills,
    SUM (fx_rate * filled_quantity * average_price) notional,
    COUNT (fx_rate * filled_quantity * average_price) cnt_notional,
    SUM (fx_rate * fills_number * average_price) total_price,
    COUNT (fx_rate * fills_number * average_price) cnt_total_price,
    SUM (CASE
    WHEN order_status = 'C'
    THEN 1
    ELSE 0
    END) cancelled_orders_count,
    COUNT (CASE
    WHEN order_status = 'C'
    THEN 1
    ELSE 0
    END
    ) cnt_cancelled_orders_count,
    -- SUM(t.FX_RATE*t.NO_FILLS*t.AVG_PRICE) AVERAGE_PRICE,
    -- SUM(FILLS_NUMBER*AVERAGE_PRICE) STAGING_AVERAGE_PRICE,
    -- COUNT(FILLS_NUMBER*AVERAGE_PRICE) CNT_STAGING_AVERAGE_PRICE,
    SUM (routed_orders_no) routed_orders_no,
    COUNT (routed_orders_no) cnt_routed_orders_no,
    SUM (routed_liquidity_qty) routed_liquidity_qty,
    COUNT (routed_liquidity_qty) cnt_routed_liquidity_qty,
    SUM (removed_liquidity_qty) removed_liquidity_qty,
    COUNT (removed_liquidity_qty) cnt_removed_liquidity_qty,
    SUM (added_liquidity_qty) added_liquidity_qty,
    COUNT (added_liquidity_qty) cnt_added_liquidity_qty,
    SUM (agent_charges) agent_charges,
    COUNT (agent_charges) cnt_agent_charges,
    SUM (clearing_charges) clearing_charges,
    COUNT (clearing_charges) cnt_clearing_charges,
    SUM (execution_charges) execution_charges,
    COUNT (execution_charges) cnt_execution_charges,
    SUM (transaction_charges) transaction_charges,
    COUNT (transaction_charges) cnt_transaction_charges,
    SUM (order_management) order_management,
    COUNT (order_management) cnt_order_management,
    SUM (settlement_charges) settlement_charges,
    COUNT (settlement_charges) cnt_settlement_charges,
    SUM (recovered_agent) recovered_agent,
    COUNT (recovered_agent) cnt_recovered_agent,
    SUM (recovered_clearing) recovered_clearing,
    COUNT (recovered_clearing) cnt_recovered_clearing,
    SUM (recovered_execution) recovered_execution,
    COUNT (recovered_execution) cnt_recovered_execution,
    SUM (recovered_transaction) recovered_transaction,
    COUNT (recovered_transaction) cnt_recovered_transaction,
    SUM (recovered_ord_mgt) recovered_ord_mgt,
    COUNT (recovered_ord_mgt) cnt_recovered_ord_mgt,
    SUM (recovered_settlement) recovered_settlement,
    COUNT (recovered_settlement) cnt_recovered_settlement,
    SUM (client_agent) client_agent,
    COUNT (client_agent) cnt_client_agent,
    SUM (client_order_mgt) client_order_mgt,
    COUNT (client_order_mgt) cnt_client_order_mgt,
    SUM (client_exec) client_exec, COUNT (client_exec) cnt_client_exec,
    SUM (client_trans) client_trans,
    COUNT (client_trans) cnt_client_trans,
    SUM (client_clearing) client_clearing,
    COUNT (client_clearing) cnt_client_clearing,
    SUM (client_settle) client_settle,
    COUNT (client_settle) cnt_client_settle,
    SUM (chargeable_taxes) chargeable_taxes,
    COUNT (chargeable_taxes) cnt_chargeable_taxes,
    SUM (vendor_charge) vendor_charge,
    COUNT (vendor_charge) cnt_vendor_charge,
    SUM (routing_charges) routing_charges,
    COUNT (routing_charges) cnt_routing_charges,
    SUM (recovered_routing) recovered_routing,
    COUNT (recovered_routing) cnt_recovered_routing,
    SUM (client_routing) client_routing,
    COUNT (client_routing) cnt_client_routing,
    SUM (ticket_charges) ticket_charges,
    COUNT (ticket_charges) cnt_ticket_charges,
    SUM (recovered_ticket_charges) recovered_ticket_charges,
    COUNT (recovered_ticket_charges) cnt_recovered_ticket_charges
    FROM us_datamart_raw
    GROUP BY order_date,
    if_system,
    business_dim_id,
    time_dim_id,
    account_dim_id,
    ordertype_dim_id,
    instr_dim_id,
    execution_dim_id,
    exec_exchange_dim_id;
    -- Note: Index I_SNAP$_MV_US_DATAMART will be created automatically
    -- by Oracle with the associated materialized view.
    CREATE UNIQUE INDEX OS_OWNER.MV_US_DATAMART_UDX ON OS_OWNER.MV_US_DATAMART
    (ORDER_DATE, TIME_DIM_ID, BUSINESS_DIM_ID, ACCOUNT_DIM_ID, ORDERTYPE_DIM_ID,
    INSTR_DIM_ID, EXECUTION_DIM_ID, EXEC_EXCHANGE_DIM_ID)
    NOLOGGING
    NOPARALLEL
    COMPRESS 7;
    No of rows: 2228558
    The query (taken Mondrian) I run against each of them is:
    select sum("MV_US_DATAMART"."NOTIONAL") as "m0"
    --, sum("MV_US_DATAMART"."FILLED_QUANTITY") as "m1"
    --, sum("MV_US_DATAMART"."AGENT_CHARGES") as "m2"
    --, sum("MV_US_DATAMART"."CLEARING_CHARGES") as "m3"
    --, sum("MV_US_DATAMART"."EXECUTION_CHARGES") as "m4"
    --, sum("MV_US_DATAMART"."TRANSACTION_CHARGES") as "m5"
    --, sum("MV_US_DATAMART"."ROUTING_CHARGES") as "m6"
    --, sum("MV_US_DATAMART"."ORDER_MANAGEMENT") as "m7"
    --, sum("MV_US_DATAMART"."SETTLEMENT_CHARGES") as "m8"
    --, sum("MV_US_DATAMART"."COMMISSION") as "m9"
    --, sum("MV_US_DATAMART"."RECOVERED_AGENT") as "m10"
    --, sum("MV_US_DATAMART"."RECOVERED_CLEARING") as "m11"
    --,sum("MV_US_DATAMART"."RECOVERED_EXECUTION") as "m12"
    --,sum("MV_US_DATAMART"."RECOVERED_TRANSACTION") as "m13"
    --, sum("MV_US_DATAMART"."RECOVERED_ROUTING") as "m14"
    --, sum("MV_US_DATAMART"."RECOVERED_ORD_MGT") as "m15"
    --, sum("MV_US_DATAMART"."RECOVERED_SETTLEMENT") as "m16"
    --, sum("MV_US_DATAMART"."RECOVERED_TICKET_CHARGES") as "m17"
    --,sum("MV_US_DATAMART"."TICKET_CHARGES") as "m18"
    --, sum("MV_US_DATAMART"."VENDOR_CHARGE") as "m19"
              from "OS_OWNER"."MV_US_DATAMART" "MV_US_DATAMART"
    where I uncomment a column at a time and rerun. I improved the TimesTen results since my first post, by retyping the NUMBER columns to BINARY_FLOAT. The results I got were:
    No Columns     ORACLE     TimesTen     
    1     1.05     0.94     
    2     1.07     1.47     
    3     2.04     1.8     
    4     2.06     2.08     
    5     2.09     2.4     
    6     3.01     2.67     
    7     4.02     3.06     
    8     4.03     3.37     
    9     4.04     3.62     
    10     4.06     4.02     
    11     4.08     4.31     
    12     4.09     4.61     
    13     5.01     4.76     
    14     5.02     5.06     
    15     5.04     5.25     
    16     5.05     5.48     
    17     5.08     5.84     
    18     6     6.21     
    19     6.02     6.34     
    20     6.04     6.75

  • Sql query is taking more time

    Hi all,
    db:oracle 9i
    I am facing below query prob.
    prob is that query is taking more time 45 min than earliar (10 sec).
    please any one suggest me .....
    SQL> SELECT MAX (tdar1.ID) ID, tdar1.request_id, tdar1.lolm_transaction_id,
    2 tdar1.transaction_version
    3 FROM transaction_data_arc tdar1
    4 WHERE tdar1.transaction_name ='O96U '
    5 AND tdar1.transaction_type = 'REQUEST'
    6 AND tdar1.message_type_code ='PCN'
    7 AND NOT EXISTS (
    8 SELECT NULL
    9 FROM transaction_data_arc tdar2
    10 WHERE tdar2.request_id = tdar1.request_id
    11 AND tdar2.lolm_transaction_id != tdar1.lolm_transaction_id
    12 AND tdar2.ID > tdar1.ID)
    13 GROUP BY tdar1.request_id,
    14 tdar1.lolm_transaction_id,
    15 tdar1.transaction_version;
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=17 Card=1 Bytes=42)
    1 0 SORT (GROUP BY) (Cost=12 Card=1 Bytes=42)
    2 1 FILTER
    3 2 TABLE ACCESS (BY INDEX ROWID) OF 'TRANSACTION_DATA_ARC
    ' (Cost=1 Card=1 Bytes=42)
    4 3 INDEX (RANGE SCAN) OF 'NK_TDAR_2' (NON-UNIQUE) (Cost
    =3 Card=1)
    5 2 TABLE ACCESS (BY INDEX ROWID) OF 'TRANSACTION_DATA_ARC
    ' (Cost=5 Card=918 Bytes=20196)
    6 5 INDEX (RANGE SCAN) OF 'NK_TDAR_7' (NON-UNIQUE) (Cost
    =8 Card=4760)

    prob is that query is taking more time 45 min than earliar (10 sec).Then something must have changed (data growth/stale statistics/...?).
    You should post as much details as possible, how and what it is described in the FAQ, see:
    *3. How to improve the performance of my query? / My query is running slow*.
    When your query takes too long...
    How to post a SQL statement tuning request
    SQL and PL/SQL FAQ
    Also, given your database version, using NOT IN instead of NOT EXISTS might make a difference (but they're not the same).
    See: SQL and PL/SQL FAQ

  • Child Query taking more time

    Dear Gurus/Masters/All,
    I request your valuble assistance in tuning one of my SQL.
    We are using oracle 10.2.04 version and OS is HP-UX 11.23(ia64) version
    In my production environment one SQL is taking more time to complete the task. According to EXPLAIN PLAN, i observed that one of it's WHERE condition execution is causing the issue.
    I took the explain plan of the WHERE condition which is causing the issue. It is going for full table scan to satisfy the criteria. But a normal index exists on this column.
    Main Query WHERE condition and Explain Plan.
    SELECT column list ....
    FROM
        SIEBEL.S_ADDR_PER T1,
        SIEBEL.S_PTY_PAY_PRFL T2,
        SIEBEL.S_INVLOC T3,
        SIEBEL.S_ORDER T4,
        SIEBEL.S_ORG_EXT T5,
        SIEBEL.S_POSTN T6,
        SIEBEL.S_PARTY T7,
        SIEBEL.S_PROJ T8,
        SIEBEL.S_CON_ADDR T9,
        SIEBEL.S_ORG_EXT T10,
        SIEBEL.S_USER T11,
        SIEBEL.S_DOC_QUOTE T12,
        SIEBEL.S_ACCNT_POSTN T13,
        SIEBEL.S_INS_CLAIM T14,
        SIEBEL.S_USER T15,
        SIEBEL.S_ORG_EXT T16,
        SIEBEL.S_ASSET T17,
        SIEBEL.S_ORDER_TNTX T18,
        SIEBEL.S_ORG_EXT_TNTX T19,
        SIEBEL.S_PERIOD T20,
        SIEBEL.S_DEPOSIT_TNT T21,
        SIEBEL.S_ADDR_PER T22,
        SIEBEL.S_PAYMENT_TERM T23,
        SIEBEL.S_ORG_EXT_X T24,
        SIEBEL.S_ORG_EXT T25,
        SIEBEL.S_INSCLM_ELMNT T26,
        SIEBEL.S_INVOICE T27
    WHERE
       T25.BU_ID = T10.PAR_ROW_ID (+) AND
       T26.INSCLM_ID = T14.ROW_ID (+) AND
       T27.ELEMENT_ID = T26.ROW_ID (+) AND
       T27.LAST_UPD_BY = T15.PAR_ROW_ID (+) AND
       T4.QUOTE_ID = T12.ROW_ID (+) AND
       T3.CG_ASSSET_ID = T17.ROW_ID (+) AND
       T27.BL_ADDR_ID = T22.ROW_ID (+) AND
       T8.BU_ID = T5.PAR_ROW_ID (+) AND
       T27.PER_PAY_PRFL_ID = T2.ROW_ID (+) AND
       T27.REMIT_ORG_EXT_ID = T16.PAR_ROW_ID (+) AND
       T27.PROJ_ID = T8.ROW_ID (+) AND
       T27.BL_PERIOD_ID = T20.ROW_ID (+) AND
       T27.PAYMENT_TERM_ID = T23.ROW_ID (+) AND
       T12.BU_ID = T19.PAR_ROW_ID (+) AND
       T27.ACCNT_ID = T25.PAR_ROW_ID (+) AND
       T27.ORDER_ID = T18.ROW_ID (+) AND
       T4.SRC_INVLOC_ID = T3.ROW_ID (+) AND
       T27.ORDER_ID = T4.ROW_ID (+) AND
       T27.ACCNT_ID = T24.PAR_ROW_ID (+) AND
       T18.PR_DEPOSIT_ID = T21.ROW_ID (+) AND
       T27.BL_ADDR_ID = T9.ADDR_PER_ID (+) AND T27.ACCNT_ID = T9.ACCNT_ID (+) AND
       T27.BL_ADDR_ID = T1.ROW_ID (+) AND
       T25.PR_POSTN_ID = T13.POSITION_ID (+) AND T25.ROW_ID = T13.OU_EXT_ID (+) AND
       T13.POSITION_ID = T7.ROW_ID (+) AND
       T13.POSITION_ID = T6.PAR_ROW_ID (+) AND
       T6.PR_EMP_ID = T11.PAR_ROW_ID (+) AND
       (T27.INVC_TYPE_CD = :1)
    ORDER BY
       T27.INVC_DT;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2576210427
    | Id  | Operation                                              | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                                       |                   |    39M|    71G|       |   624M  (1)|278:42:59 |
    |   1 |  SORT ORDER BY                                         |                   |    39M|    71G|   150G|   624M  (1)|278:42:59 |
    |   2 |   NESTED LOOPS OUTER                                   |                   |    39M|    71G|       |   610M  (1)|272:11:24 |
    |   3 |    NESTED LOOPS OUTER                                  |                   |    39M|    70G|       |   515M  (1)|229:48:41 |
    |   4 |     NESTED LOOPS OUTER                                 |                   |    39M|    69G|       |   483M  (1)|215:41:04 |
    |   5 |      NESTED LOOPS OUTER                                |                   |    39M|    68G|       |   483M  (1)|215:41:04 |
    |   6 |       NESTED LOOPS OUTER                               |                   |    39M|    67G|       |   483M  (1)|215:41:04 |
    |   7 |        NESTED LOOPS OUTER                              |                   |    39M|    66G|       |   406M  (1)|181:17:50 |
    |   8 |         NESTED LOOPS OUTER                             |                   |    39M|    65G|       |   343M  (1)|153:12:57 |
    |   9 |          NESTED LOOPS OUTER                            |                   |    39M|    64G|       |   311M  (1)|139:04:56 |
    |  10 |           NESTED LOOPS OUTER                           |                   |    39M|    63G|       |   185M  (1)| 82:37:56 |
    |  11 |            NESTED LOOPS OUTER                          |                   |    39M|    54G|       |   108M  (1)| 48:11:29 |
    |  12 |             NESTED LOOPS OUTER                         |                   |    39M|    53G|       |   108M  (1)| 48:11:29 |
    |  13 |              NESTED LOOPS OUTER                        |                   |    39M|    51G|       |    76M  (1)| 34:03:51 |
    |  14 |               NESTED LOOPS OUTER                       |                   |    39M|    49G|       |    76M  (1)| 34:03:51 |
    |  15 |                NESTED LOOPS OUTER                      |                   |    39M|    46G|       |    76M  (1)| 34:03:51 |
    |  16 |                 NESTED LOOPS OUTER                     |                   |    39M|    44G|       |    76M  (1)| 34:03:51 |
    |  17 |                  NESTED LOOPS OUTER                    |                   |    39M|    40G|       |    65M  (1)| 29:25:49 |
    |  18 |                   NESTED LOOPS OUTER                   |                   |    39M|    39G|       |    65M  (1)| 29:25:49 |
    |  19 |                    NESTED LOOPS OUTER                  |                   |    39M|    38G|       |    65M  (1)| 29:25:49 |
    |  20 |                     NESTED LOOPS OUTER                 |                   |    39M|    34G|       |    65M  (1)| 29:17:44 |
    |  21 |                      NESTED LOOPS OUTER                |                   |    39M|    32G|       |    65M  (1)| 29:17:08 |
    |  22 |                       NESTED LOOPS OUTER               |                   |    39M|    31G|       |    65M  (1)| 29:09:04 |
    |  23 |                        NESTED LOOPS OUTER              |                   |    39M|    30G|       |  2043K  (9)| 00:54:42 |
    |  24 |                         NESTED LOOPS OUTER             |                   |    39M|    30G|       |  2043K  (9)| 00:54:42 |
    |  25 |                          NESTED LOOPS OUTER            |                   |    39M|    25G|       |  2015K  (7)| 00:53:57 |
    |  26 |                           NESTED LOOPS OUTER           |                   |    39M|    22G|       |  2015K  (7)| 00:53:57 |
    |  27 |                            NESTED LOOPS OUTER          |                   |    39M|    16G|       |  2015K  (7)| 00:53:57 |
    |* 28 |                             TABLE ACCESS FULL          | S_INVOICE         |    39M|     9G|       |  2015K  (7)| 00:53:57 |
    |  29 |                             TABLE ACCESS BY INDEX ROWID| S_PROJ            |     1 |   188 |       |     1   (0)| 00:00:01 |
    |* 30 |                              INDEX UNIQUE SCAN         | S_PROJ_P1         |     1 |       |       |     1   (0)| 00:00:01 |
    |  31 |                            TABLE ACCESS BY INDEX ROWID | S_PAYMENT_TERM    |     1 |   156 |       |     1   (0)| 00:00:01 |
    |* 32 |                             INDEX UNIQUE SCAN          | S_PAYMENT_TERM_P1 |     1 |       |       |     1   (0)| 00:00:01 |
    |  33 |                           TABLE ACCESS BY INDEX ROWID  | S_INSCLM_ELMNT    |     1 |    77 |       |     1   (0)| 00:00:01 |
    |* 34 |                            INDEX UNIQUE SCAN           | S_INSCLM_ELMNT_P1 |     1 |       |       |     1   (0)| 00:00:01 |
    |  35 |                          TABLE ACCESS BY INDEX ROWID   | S_INS_CLAIM       |     1 |   134 |       |     1   (0)| 00:00:01 |
    |* 36 |                           INDEX UNIQUE SCAN            | S_INS_CLAIM_P1    |     1 |       |       |     1   (0)| 00:00:01 |
    |  37 |                         TABLE ACCESS BY INDEX ROWID    | S_PERIOD          |     1 |    19 |       |     1   (0)| 00:00:01 |
    |* 38 |                          INDEX UNIQUE SCAN             | S_PERIOD_P1       |     1 |       |       |     1   (0)| 00:00:01 |
    |  39 |                        TABLE ACCESS BY INDEX ROWID     | S_USER            |     1 |    25 |       |     2   (0)| 00:00:01 |
    |* 40 |                         INDEX UNIQUE SCAN              | S_USER_U2         |     1 |       |       |     1   (0)| 00:00:01 |
    |  41 |                       TABLE ACCESS BY INDEX ROWID      | S_ORDER_TNTX      |     1 |    26 |       |     2   (0)| 00:00:01 |
    |* 42 |                        INDEX UNIQUE SCAN               | S_ORDER_TNTX_P1   |     1 |       |       |     1   (0)| 00:00:01 |
    |  43 |                      TABLE ACCESS BY INDEX ROWID       | S_DEPOSIT_TNT     |     1 |    45 |       |     1   (0)| 00:00:01 |
    |* 44 |                       INDEX UNIQUE SCAN                | S_DEPOSIT_TNT_P1  |     1 |       |       |     1   (0)| 00:00:01 |
    |  45 |                     TABLE ACCESS BY INDEX ROWID        | S_ORDER           |     1 |   101 |       |     2   (0)| 00:00:01 |
    |* 46 |                      INDEX UNIQUE SCAN                 | S_ORDER_P1        |     1 |       |       |     1   (0)| 00:00:01 |
    |  47 |                    TABLE ACCESS BY INDEX ROWID         | S_INVLOC          |     1 |    47 |       |     1   (0)| 00:00:01 |
    |* 48 |                     INDEX UNIQUE SCAN                  | S_INVLOC_P1       |     1 |       |       |     1   (0)| 00:00:01 |
    |  49 |                   TABLE ACCESS BY INDEX ROWID          | S_DOC_QUOTE       |     1 |    21 |       |     1   (0)| 00:00:01 |
    |* 50 |                    INDEX UNIQUE SCAN                   | S_DOC_QUOTE_P1    |     1 |       |       |     1   (0)| 00:00:01 |
    |* 51 |                  TABLE ACCESS FULL                     | S_ORG_EXT_TNTX    |     1 |    94 |       |     0   (0)| 00:00:01 |
    |  52 |                 TABLE ACCESS BY INDEX ROWID            | S_PTY_PAY_PRFL    |     1 |    74 |       |     1   (0)| 00:00:01 |
    |* 53 |                  INDEX UNIQUE SCAN                     | S_PTY_PAY_PRFL_P1 |     1 |       |       |     1   (0)| 00:00:01 |
    |  54 |                TABLE ACCESS BY INDEX ROWID             | S_ADDR_PER        |     1 |    84 |       |     2   (0)| 00:00:01 |
    |* 55 |                 INDEX UNIQUE SCAN                      | S_ADDR_PER_P1     |     1 |       |       |     1   (0)| 00:00:01 |
    |  56 |               TABLE ACCESS BY INDEX ROWID              | S_ADDR_PER        |     1 |    57 |       |     1   (0)| 00:00:01 |
    |* 57 |                INDEX UNIQUE SCAN                       | S_ADDR_PER_P1     |     1 |       |       |     1   (0)| 00:00:01 |
    |  58 |              TABLE ACCESS BY INDEX ROWID               | S_ORG_EXT         |     1 |    32 |       |     1   (0)| 00:00:01 |
    |* 59 |               INDEX UNIQUE SCAN                        | S_ORG_EXT_U3      |     1 |       |       |     1   (0)| 00:00:01 |
    |  60 |             TABLE ACCESS BY INDEX ROWID                | S_ORG_EXT         |     1 |    32 |       |     1   (0)| 00:00:01 |
    |* 61 |              INDEX UNIQUE SCAN                         | S_ORG_EXT_U3      |     1 |       |       |     1   (0)| 00:00:01 |
    |  62 |            TABLE ACCESS BY INDEX ROWID                 | S_ORG_EXT         |     1 |   256 |       |     2   (0)| 00:00:01 |
    |* 63 |             INDEX UNIQUE SCAN                          | S_ORG_EXT_U3      |     1 |       |       |     1   (0)| 00:00:01 |
    |  64 |           TABLE ACCESS BY INDEX ROWID                  | S_ACCNT_POSTN     |     1 |    32 |       |     3   (0)| 00:00:01 |
    |* 65 |            INDEX RANGE SCAN                            | S_ACCNT_POSTN_U1  |     1 |       |       |     2   (0)| 00:00:01 |
    |  66 |          TABLE ACCESS BY INDEX ROWID                   | S_POSTN           |     1 |    21 |       |     1   (0)| 00:00:01 |
    |* 67 |           INDEX UNIQUE SCAN                            | S_POSTN_U2        |     1 |       |       |     1   (0)| 00:00:01 |
    |  68 |         TABLE ACCESS BY INDEX ROWID                    | S_USER            |     1 |    25 |       |     2   (0)| 00:00:01 |
    |* 69 |          INDEX UNIQUE SCAN                             | S_USER_U2         |     1 |       |       |     1   (0)| 00:00:01 |
    |  70 |        TABLE ACCESS BY INDEX ROWID                     | S_ORG_EXT         |     1 |    32 |       |     2   (0)| 00:00:01 |
    |* 71 |         INDEX UNIQUE SCAN                              | S_ORG_EXT_U3      |     1 |       |       |     1   (0)| 00:00:01 |
    |  72 |       TABLE ACCESS BY INDEX ROWID                      | S_ASSET           |     1 |    24 |       |     2   (0)| 00:00:01 |
    |* 73 |        INDEX UNIQUE SCAN                               | S_ASSET_P1        |     1 |       |       |     2   (0)| 00:00:01 |
    |  74 |      TABLE ACCESS BY INDEX ROWID                       | S_CON_ADDR        |     1 |    36 |       |     3   (0)| 00:00:01 |
    |* 75 |       INDEX RANGE SCAN                                 | S_CON_ADDR_U1     |     1 |       |       |     2   (0)| 00:00:01 |
    |* 76 |     INDEX UNIQUE SCAN                                  | S_PARTY_P1        |     1 |    12 |       |     1   (0)| 00:00:01 |
    |  77 |    TABLE ACCESS BY INDEX ROWID                         | S_ORG_EXT_X       |     1 |    37 |       |     2   (0)| 00:00:01 |
    |* 78 |     INDEX RANGE SCAN                                   | S_ORG_EXT_X_U1    |     1 |       |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
      28 - filter("T27"."INVC_TYPE_CD"=:1)
      30 - access("T27"."PROJ_ID"="T8"."ROW_ID"(+))
      32 - access("T27"."PAYMENT_TERM_ID"="T23"."ROW_ID"(+))
      34 - access("T27"."ELEMENT_ID"="T26"."ROW_ID"(+))
      36 - access("T26"."INSCLM_ID"="T14"."ROW_ID"(+))
      38 - access("T27"."BL_PERIOD_ID"="T20"."ROW_ID"(+))
      40 - access("T27"."LAST_UPD_BY"="T15"."PAR_ROW_ID"(+))
      42 - access("T27"."ORDER_ID"="T18"."ROW_ID"(+))
      44 - access("T18"."PR_DEPOSIT_ID"="T21"."ROW_ID"(+))
      46 - access("T27"."ORDER_ID"="T4"."ROW_ID"(+))
      48 - access("T4"."SRC_INVLOC_ID"="T3"."ROW_ID"(+))
      50 - access("T4"."QUOTE_ID"="T12"."ROW_ID"(+))
      51 - filter("T12"."BU_ID"="T19"."PAR_ROW_ID"(+))
      53 - access("T27"."PER_PAY_PRFL_ID"="T2"."ROW_ID"(+))
      55 - access("T27"."BL_ADDR_ID"="T1"."ROW_ID"(+))
      57 - access("T27"."BL_ADDR_ID"="T22"."ROW_ID"(+))
      59 - access("T8"."BU_ID"="T5"."PAR_ROW_ID"(+))
      61 - access("T27"."REMIT_ORG_EXT_ID"="T16"."PAR_ROW_ID"(+))
      63 - access("T27"."ACCNT_ID"="T25"."PAR_ROW_ID"(+))
      65 - access("T25"."ROW_ID"="T13"."OU_EXT_ID"(+) AND "T25"."PR_POSTN_ID"="T13"."POSITION_ID"(+))
      67 - access("T13"."POSITION_ID"="T6"."PAR_ROW_ID"(+))
      69 - access("T6"."PR_EMP_ID"="T11"."PAR_ROW_ID"(+))
      71 - access("T25"."BU_ID"="T10"."PAR_ROW_ID"(+))
      73 - access("T3"."CG_ASSSET_ID"="T17"."ROW_ID"(+))
      75 - access("T27"."BL_ADDR_ID"="T9"."ADDR_PER_ID"(+) AND "T27"."ACCNT_ID"="T9"."ACCNT_ID"(+))
           filter("T27"."ACCNT_ID"="T9"."ACCNT_ID"(+))
      76 - access("T13"."POSITION_ID"="T7"."ROW_ID"(+))
      78 - access("T27"."ACCNT_ID"="T24"."PAR_ROW_ID"(+))
    117 rows selected.SQL> EXPLAIN PLAN FOR
    2 SELECT * FROM SIEBEL.S_INVOICE T27 WHERE T27.INVC_TYPE_CD=:1;
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1810797629
    | Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |           |    39M|     9G|  2016K  (8)| 00:53:59 |
    |*  1 |  TABLE ACCESS FULL| S_INVOICE |    39M|     9G|  2016K  (8)| 00:53:59 |
    Predicate Information (identified by operation id):
       1 - filter("T27"."INVC_TYPE_CD"=:1)
    13 rows selected.Edited by: KODS on Feb 13, 2013 1:08 PM

    Dear Ivan,
    Please find the details below.
    select * from dba_indexes where index_name = 'S_INVOICE_U1';
    OWNER                          INDEX_NAME                     INDEX_TYPE                  TABLE_OWNER                    TABLE_NAME                     TABLE_TYPE  UNIQUENESS COMPRESSION PREFIX_LENGTH TABLESPACE_NAME                INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE PCT_THRESHOLD INCLUDE_COLUMN FREELISTS FREELIST_GROUPS PCT_FREE LOGGING BLEVEL LEAF_BLOCKS DISTINCT_KEYS AVG_LEAF_BLOCKS_PER_KEY AVG_DATA_BLOCKS_PER_KEY CLUSTERING_FACTOR STATUS   NUM_ROWS SAMPLE_SIZE LAST_ANALYZED DEGREE                                   INSTANCES                                PARTITIONED TEMPORARY GENERATED SECONDARY BUFFER_POOL USER_STATS DURATION        PCT_DIRECT_ACCESS ITYP_OWNER                     ITYP_NAME                      PARAMETERS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               GLOBAL_STATS DOMIDX_STATUS DOMIDX_OPSTATUS FUNCIDX_STATUS JOIN_INDEX IOT_REDUNDANT_PKEY_ELIM DROPPED
    SIEBEL                         S_INVOICE_U1                   NORMAL                      SIEBEL                         S_INVOICE                      TABLE       UNIQUE     DISABLED                  CRMSBL_AEM_INDEX                       2       255          65536                       1  2147483645                                                                           10 NO           3      902796     196739390                       1                       1         125598294 VALID    196739390   196739390 10-02-13      1                                        1                                        NO          N         N         N         DEFAULT     NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  YES                                                       NO         NO                      NO     
    select * from dba_ind_columns where index_name = 'S_INVOICE_U1' order by column_position;
    INDEX_OWNER                    INDEX_NAME                     TABLE_OWNER                    TABLE_NAME                     COLUMN_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      COLUMN_POSITION COLUMN_LENGTH CHAR_LENGTH DESCEND
    SIEBEL                         S_INVOICE_U1                   SIEBEL                         S_INVOICE                      INVC_NUM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1           200          50 ASC    
    SIEBEL                         S_INVOICE_U1                   SIEBEL                         S_INVOICE                      INVC_TYPE_CD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   2           120          30 ASC    
    SIEBEL                         S_INVOICE_U1                   SIEBEL                         S_INVOICE                      CONFLICT_ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    3            60          15 ASC    

  • Select query taking more time..

    Hi friends..
    The below inner join statement is taking more time ,  can any  body sugget me to improve the performance . I tried FOR ALL ENTRIES also but that also taking more time than inner join statement .
    SELECT a~vbeln from vbap as a inner join vakpa as b
          on avbeln = bvbeln
          into corresponding fields of table IT_VAKPA
          where a~WERKS IN S_IWERKS
          and a~pstyv NE 'ZRS'
          and b~vkorg = IVKORG
          and b~audat IN IAUDAT
          and b~vtweg IN IVTWEG.
    Regards
    Chetan

    Hi Chetan ,
    VAKPA is an index table. From the select query , it has been observed that you are not fetching any data from VAKPA. Only you have added some selection paramenters in where clause of select query.
    My suggestion will be instead of using VAKPA in inner join you use VBAK along with VBAP. All the fields that you are using as selection condition from VAKPA are there in VBAK.
    I am sure performance of query will be improved.
    If still duo to business logic you need to use VAKPA, try to create secondary non unique index on fields VKORD,AUDATand VTWEG on table VAKPA.
    However I will recommend you to go for first option only. If this does not work then go for second option.
    Hopfully this will help you.
    Regards,
    Nikhil

  • BSAD table is taking more time in select query.

    Hi ,
    The below SELECT query is taking more time , there is no any secondary index is there .
    Can anybody suggest how to improve it .
    SELECT bukrs
             kunnr
             augdt
             augbl
             gjahr
             belnr
             budat
             bldat
             waers
             xblnr
             BLART
             monat
             shkzg
             gsber
             DMBTR
             WRBTR
             prctr
             FROM  BSAD INTO TABLE gt_bsad
             WHERE  bukrs  = p_bukrs
             AND    kunnr  IN so_kunnr
             AND    budat  IN so_budat
             AND    xblnr  IN so_xblnr
             AND  ( blart  EQ 'DA' OR
                    blart  EQ 'DZ' OR
                    blart  EQ 'ZP' OR               "D03K904574
                    blart  EQ 'KZ' OR               "D03K904574
                    blart  EQ 'DP' )
             AND   PRCTR IN R_PC.
    Thanks in advance
    Regards
    chetan

    Hi Chetan ,
    I will suggest you two things :
    1. Try to add Secondary ( Non-unique) index on table BSAD with fields : mandt,bukrs,kunnr,budat,xblnr,blart,prctr.
        but before adding this index test the selectivity of this index by going to Tcode DB05
    2. In the select query you have used OR condition for blart. Instead of this try to create a ranges table for blart and append the  values 'DA','DZ','ZP','KZ','DP' and use this in the select query. This will improve the performance for sure.
    Hope this will help to ypu.
    Regards,
    Nikhil

  • Query is taking more time to execute

    Hi,
    Query is taking more time to execute.
    But when i execute same query in other server then it is giving immediate output.
    What is the reason of it.
    thanks in advance.

    'My car doesn't start, please help me to start my car'
    Do you think we are clairvoyant?
    Or is your salary subtracted for every letter you type here?
    Please be aware this is not a chatroom, and we can not see your webcam.
    Sybrand Bakker
    Senior Oracle DBA

  • Query is taking more time to execute in PROD

    Hi All,
    Can anyone tell me why this query is taking more time when I am using for single trx_number record it is working fine but when I am trying to use all the records it is not fatching any records and it is keep on running.
    SELECT DISTINCT OOH.HEADER_ID
    ,OOH.ORG_ID
    ,ct.CUSTOMER_TRX_ID
    ,ool.ship_from_org_id
    ,ct.trx_number IDP_SHIPMENT_ID
    ,ctt.type STATUS_CODE
    ,SYSDATE STATUS_DATE
    ,ooh.attribute16 IDP_ORDER_NBR --Change based on testing on 21-JUL-2010 in UAT
    ,lpad(rac_bill.account_number,6,0) IDP_BILL_TO_CUSTOMER_NBR
    ,rac_bill.orig_system_reference
    ,rac_ship_party.party_name SHIP_TO_NAME
    ,raa_ship_loc.address1 SHIP_TO_ADDR1
    ,raa_ship_loc.address2 SHIP_TO_ADDR2
    ,raa_ship_loc.address3 SHIP_TO_ADDR3
    ,raa_ship_loc.address4 SHIP_TO_ADDR4
    ,raa_ship_loc.city SHIP_TO_CITY
    ,NVL(raa_ship_loc.state,raa_ship_loc.province) SHIP_TO_STATE
    ,raa_ship_loc.country SHIP_TO_COUNTRY_NAME
    ,raa_ship_loc.postal_code SHIP_TO_ZIP
    ,ooh.CUST_PO_NUMBER CUSTOMER_ORDER_NBR
    ,ooh.creation_date CUSTOMER_ORDER_DATE
    ,ool.actual_shipment_date DATE_SHIPPED
    ,DECODE(mp.organization_code,'CHP', 'CHESAPEAKE'
    ,'CSB', 'CHESAPEAKE'
    ,'DEP', 'CHESAPEAKE'
    ,'CHESAPEAKE') SHIPPED_FROM_LOCATION --'MEMPHIS' --'HOUSTON'
    ,ooh.freight_carrier_code FREIGHT_CARRIER
    ,NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('FREIGHT',ct.customer_trx_id,ct.org_id),0)
    + NVL(XX_FSG_NA_FASTRAQ_IFACE.get_line_fr_amt ('FREIGHT',ct.customer_trx_id,ct.org_id),0)FREIGHT_CHARGE
    ,ooh.freight_terms_code FREIGHT_TERMS
    ,'' IDP_BILL_OF_LADING
    ,(SELECT WAYBILL
    FROM WSH_DELIVERY_DETAILS_OE_V
    WHERE -1=-1
    AND SOURCE_HEADER_ID = ooh.header_id
    AND SOURCE_LINE_ID = ool.line_id
    AND ROWNUM =1) WAYBILL_CARRIER
    ,'' CONTAINERS
    ,ct.trx_number INVOICE_NBR
    ,ct.trx_date INVOICE_DATE
    ,NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('LINE',ct.customer_trx_id,ct.org_id),0) +
    NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('TAX',ct.customer_trx_id,ct.org_id),0) +
    NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('FREIGHT',ct.customer_trx_id,ct.org_id),0)INVOICE_AMOUNT
    ,NULL IDP_TAX_IDENTIFICATION_NBR
    ,NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('TAX',ct.customer_trx_id,ct.org_id),0) TAX_AMOUNT_1
    ,NULL TAX_DESC_1
    ,NULL TAX_AMOUNT_2
    ,NULL TAX_DESC_2
    ,rt.name PAYMENT_TERMS
    ,NULL RELATED_INVOICE_NBR
    ,'Y' INVOICE_PRINT_FLAG
    FROM ra_customer_trx_all ct
    ,ra_cust_trx_types_all ctt
    ,hz_cust_accounts rac_ship
    ,hz_cust_accounts rac_bill
    ,hz_parties rac_ship_party
    ,hz_locations raa_ship_loc
    ,hz_party_sites raa_ship_ps
    ,hz_cust_acct_sites_all raa_ship
    ,hz_cust_site_uses_all su_ship
    ,ra_customer_trx_lines_all rctl
    ,oe_order_lines_all ool
    ,oe_order_headers_all ooh
    ,mtl_parameters mp
    ,ra_terms rt
    ,OE_ORDER_SOURCES oos
    ,XLA_AR_INV_AEL_SL_V XLA_AEL_SL_V
    WHERE ct.cust_trx_type_id = ctt.cust_trx_type_id
    AND ctt.TYPE <> 'BR'
    AND ct.org_id = ctt.org_id
    AND ct.ship_to_customer_id = rac_ship.cust_account_id
    AND ct.bill_to_customer_id = rac_bill.cust_account_id
    AND rac_ship.party_id = rac_ship_party.party_id
    AND su_ship.cust_acct_site_id = raa_ship.cust_acct_site_id
    AND raa_ship.party_site_id = raa_ship_ps.party_site_id
    AND raa_ship_loc.location_id = raa_ship_ps.location_id
    AND ct.ship_to_site_use_id = su_ship.site_use_id
    AND su_ship.org_id = ct.org_id
    AND raa_ship.org_id = ct.org_id
    AND ct.customer_trx_id = rctl.customer_trx_id
    AND ct.org_id = rctl.org_id
    AND rctl.interface_line_attribute6 = to_char(ool.line_id)
    AND rctl.org_id = ool.org_id
    AND ool.header_id = ooh.header_id
    AND ool.org_id = ooh.org_id
    AND mp.organization_id = ool.ship_from_org_id
    AND ooh.payment_term_id = rt.term_id
    AND xla_ael_sl_v.last_update_date >= NVL(p_last_update_date,xla_ael_sl_v.last_update_date)
    AND ooh.order_source_id = oos.order_source_id --Change based on testing on 19-May-2010
    AND oos.name = 'FASTRAQ' --Change based on testing on 19-May-2010
    AND ooh.org_id = g_org_id --Change based on testing on 19-May-2010
    AND ool.flow_status_code = 'CLOSED'
    AND xla_ael_sl_v.trx_hdr_id = ct.customer_trx_id
    AND trx_hdr_table = 'CT'
    AND xla_ael_sl_v.gl_transfer_status = 'Y'
    AND xla_ael_sl_v.accounted_dr IS NOT NULL
    AND xla_ael_sl_v.org_id = ct.org_id;
    -- AND ct.trx_number = '2000080';
    }

    Hello Friend,
    You query will definitely take more time or even fail in PROD,becuase the way it is written. Here are my few observations, may be it can help :-
    1. XLA_AR_INV_AEL_SL_V XLA_AEL_SL_V : Never use a view inside such a long query , becuase View is just a window to the records.
    and when used to join other table records, then all those tables which are used to create a view also becomes part of joining conition.
    First of all please check if you really need this view. I guess you are using to check if the records have been created as Journal entries or not ?
    Please check the possbility of finding it through other AR tables.
    2. Remove _ALL tables instead use the corresponding org specific views (if you are in 11i ) or the sysnonymns ( in R12 )
    For example : For ra_cust_trx_types_all use ra_cust_trx_types.
    This will ensure that the query will execute only for those ORG_IDs which are assigned to that responsibility.
    3. Check with the DBA whether the GATHER SCHEMA STATS have been run atleast for ONT and RA tables.
    You can also check the same using
    SELECT LAST_ANALYZED FROM ALL_TABLES WHERE TABLE_NAME = 'ra_customer_trx_all'.
    If the tables are not analyzed , the CBO will not be able to tune your query.
    4. Try to remove the DISTINCT keyword. This is the MAJOR reason for this problem.
    5. If its a report , try to separate the logic in separate queries ( using a procedure ) and then populate the whole data in custom table, and use this custom table for generating the
    report.
    Thanks,
    Neeraj Shrivastava
    [email protected]
    Edited by: user9352949 on Oct 1, 2010 8:02 PM
    Edited by: user9352949 on Oct 1, 2010 8:03 PM

  • Cube content deletion is taking more time than usual.

    Hi Experts,
    We have a Process chain which ideally should run in every two hours. This chain has a delete data cube content step before the new data is loaded in the cube. This chain is running fine for one instance & the other instance is taking more time so it is quite intermittent.
    In the process chain we are also deleting contents from the Dimension tables (in the delete content step). Need your inputs to improve the performance of this step.
    Thanks & Regards
    Mayank Tyagi.

    Hi Mayank ,
    You can delete the indexes of the cube before deleting the contents of the cube . The concept is same as of data loading that data loads happens faster when indexes are deleted .
    If you are having aggregates over this cube , then that aggregate will be also adjusted .
    Kind Regards,
    Ashutosh Singh

  • "3.x Analyzer Server" EVENT taking more Time when Executing Query

    Hi All,
    When I am Executing the Query Through RSRT   taking more time. When I have checked the statistics
    and observed that "3.x Analyzer Server" EVENT taking more Time .
    What I have to do , How I will reduce this 3.x Analyzer Server EVENT time.
    Please Suggest me.
    Thanks,
    Kiran Manyam

    Hello,
    Chk this on query performance:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4c0ab590-0201-0010-bd9a-8332d8b4f09c
    Query Performance
    Reg,
    Dhanya

  • Update query in sql taking more time

    Hi
    I am running an update query which takeing more time any help to run this fast.
    update arm538e_tmp t
    set t.qtr5 =(select (sum(nvl(m.net_sales_value,0))/1000) from mnthly_sales_actvty m
    where m.vndr#=t.vndr#
    and m.cust_type_cd=t.cust_type
    and m.cust_type_cd<>13
    and m.yymm between 201301 and 201303
    group by m.vndr#,m.cust_type_cd;
    help will be appreciable
    thank you

    This is the Reports forum. Ask this in the SQL and PL/SQL forum.

  • Update query which taking more time

    Hi
    I am running an update query which takeing more time any help to run this fast.
    update arm538e_tmp t
    set t.qtr5 =(select (sum(nvl(m.net_sales_value,0))/1000) from mnthly_sales_actvty m
    where m.vndr#=t.vndr#
    and m.cust_type_cd=t.cust_type
    and m.cust_type_cd<>13
    and m.yymm between 201301 and 201303
    group by m.vndr#,m.cust_type_cd;
    help will be appreciable
    thank you
    Edited by: 960991 on Apr 16, 2013 7:11 AM

    960991 wrote:
    Hi
    I am running an update query which takeing more time any help to run this fast.
    update arm538e_tmp t
    set t.qtr5 =(select (sum(nvl(m.net_sales_value,0))/1000) from mnthly_sales_actvty m
    where m.vndr#=t.vndr#
    and m.cust_type_cd=t.cust_type
    and m.cust_type_cd13
    and m.yymm between 201301 and 201303
    group by m.vndr#,m.cust_type_cd;
    help will be appreciable
    thank youUpdates with subqueries can be slow. Get an execution plan for the update to see what SQL is doing.
    Some things to look at ...
    1. Are you sure you posted the right SQL? I could not "balance" the parenthesis - 4 "(" and 3 ")"
    2. Unnecessary "(" ")" in the subquery "(sum" are confusing
    3. Updates with subqueries can be slow. The tqtr5 value seems to evaluate to a constant. You might improve performance by computing the value beforehand and using a variable instead of the subquery
    4. Subquery appears to be correlated - good! Make sure the subquery is properly indexed if it reads < 20% of the rows in the table (this figure depends on the version of Oracle)
    5. Is tqtr5 part of an index? It is a bad idea to update indexed columns

Maybe you are looking for

  • Derive week number of that month

    Hi, I need to derive week number based on month. Ex: Sy-datum = 10.10.2010 Month: 10.2010 Calweek: 40.2010 Week no: 2 Sy-datum = 11.10.2010 Month: 10.2010 Calweek: 41.2010 Week no: 3 So for everymonth I need to store the week no in the cube Ex Date--

  • Error during install of Mini WAS 6.20

    All, I'm getting the following error message(s): InfoExtracting the Database-Dependent SAP system Executables Warning: CDSERVERBASE ConfirmKey 2 816 Can not read from F:. Please ensure this path is accessible. Info: LvKeyRequest For further informati

  • Pulling filepath info from range of pdf's in folder, inserting into excel (VBScript)

    I can code getting page numbers and placing into an excel spreadsheet.  However I need a dialog to pop up asking for a folder path, then the code should count the number of pdf's in the folder and write the folder path to the first cell, number of .p

  • Skype Connection

    I have tried installing Skype through every means possible - synaptic, website, old versions etc. but Skype will not connect.  When I try the normal method of contacting it states that the Chat Operator has opened in a new window but THERE IS NO NEW

  • Simple Feature Greatly Needed

    "Show Invisibles", Please allow the user to see paragraph, tab, space and soft return symbols. Our (Newspaper) editorial department is looking for a viable alternative to MS Word. Our writers don't need much in the way of WP power... just the basics