Accessing Tables using global index rowid is taking too long.

I am using Oracle 10.2.0.4.0. I am having tables which are ~100+GB in size which is range partitioned on a date column and hash subpartitioned on primary key column. And accessing these tables using global index row id using idex range scan( size of those indexes are ~7+ GB) taking ~5+ mins which results in ~1000 rows as out put. So is this means there is some structural problem with tables/indexes or its something issue at block level? How to dig more into this issue?

Hi,
930254 wrote:
I am using Oracle 10.2.0.4.0. I am having tables which are ~100+GB in size which is range partitioned on a date column and hash subpartitioned on primary key column. And accessing these tables using global index row id using idex range scan( size of those indexes are ~7+ GB) taking ~5+ mins which results in ~1000 rows as out put. So is this means there is some structural problem with tables/indexes or its something issue at block level? How to dig more into this issue?once you get a chance to run the query and collect some diagnostic info, here are the questions that you should ask yourself:
1) where is the 5 mins spent? doing index range scan itself, doing table index access by global rowid, waiting for something, doing something else?
2) how many reads are there and what kind (logical, physical, direct path)? per the entire query and per index range scan
3) is there any aggregation in the query? if there is, then 1000 rows output doesn't mean anything -- you could have to access millions or billions of rows to produce a 1000 row output in an aggregate query
The best tool to answer these questions is dbms_xplan.
Best regards,
Nikolay

Similar Messages

  • Importing a table with a BLOB column is taking too long

    I am importing a user schema from 9i (9.2.0.6) database to 10g (10.2.1.0) database. One of the large tables (millions of records) with a BLOB column is taking too long to import (more that 24 hours). I have tried all the tricks I know to speed up the import. Here are some of the setting:
    1 - set buffer to 500 Mb
    2 - pre-created the table and turned off logging
    3 - set indexes=N
    4 - set constraints=N
    5 - I have 10 online redo logs with 200 MB each
    6 - Even turned off logging at the database level with disablelogging = true
    It is still taking too long loading the table with the BLOB column. The BLOB field contains PDF files.
    For your info:
    Computer: Sun v490 with 16 CPUs, solaris 10
    memory: 10 Gigabytes
    SGA: 4 Gigabytes

    Legatti,
    I have feedback=10000. However by monitoring the import, I know that its loading average of 130 records per minute. Which is very slow considering that the table contains close to two millions records.
    Thanks for your reply.

  • SQL Update statement taking too long..

    Hi All,
    I have a simple update statement that goes through a table of 95000 rows that is taking too long to update; here are the details:
    Oracle Version: 11.2.0.1 64bit
    OS: Windows 2008 64bit
    desc temp_person;
    Name                                                                                Null?    Type
    PERSON_ID                                                                           NOT NULL NUMBER(10)
    DISTRICT_ID                                                                     NOT NULL NUMBER(10)
    FIRST_NAME                                                                                   VARCHAR2(60)
    MIDDLE_NAME                                                                                  VARCHAR2(60)
    LAST_NAME                                                                                    VARCHAR2(60)
    BIRTH_DATE                                                                                   DATE
    SIN                                                                                          VARCHAR2(11)
    PARTY_ID                                                                                     NUMBER(10)
    ACTIVE_STATUS                                                                       NOT NULL VARCHAR2(1)
    TAXABLE_FLAG                                                                                 VARCHAR2(1)
    CPP_EXEMPT                                                                                   VARCHAR2(1)
    EVENT_ID                                                                            NOT NULL NUMBER(10)
    USER_INFO_ID                                                                                 NUMBER(10)
    TIMESTAMP                                                                           NOT NULL DATE
    CREATE INDEX tmp_rs_PERSON_ED ON temp_person (PERSON_ID,DISTRICT_ID) TABLESPACE D_INDEX;
    Index created.
    ANALYZE INDEX tmp_PERSON_ED COMPUTE STATISTICS;
    Index analyzed.
    explain plan for update temp_person
      2  set first_name = (select trim(f_name)
      3                    from ext_names_csv
      4                               where temp_person.PERSON_ID=ext_names_csv.p_id
      5                               and   temp_person.DISTRICT_ID=ext_names_csv.ed_id);
    Explained.
    @?/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    Plan hash value: 3786226716
    | Id  | Operation                   | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT            |                | 82095 |  4649K|  2052K  (4)| 06:50:31 |
    |   1 |  UPDATE                     | TEMP_PERSON    |       |       |            |          |
    |   2 |   TABLE ACCESS FULL         | TEMP_PERSON    | 82095 |  4649K|   191   (1)| 00:00:03 |
    |*  3 |   EXTERNAL TABLE ACCESS FULL| EXT_NAMES_CSV  |     1 |   178 |    24   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter("EXT_NAMES_CSV"."P_ID"=:B1 AND "EXT_NAMES_CSV"."ED_ID"=:B2)
    Note
       - dynamic sampling used for this statement (level=2)
    19 rows selected.By the looks of it the update is going to take 6 hrs!!!
    ext_names_csv is an external table that have the same number of rows as the PERSON table.
    ROHO@rohof> desc ext_names_csv
    Name                                                                                Null?    Type
    P_ID                                                                                         NUMBER
    ED_ID                                                                                        NUMBER
    F_NAME                                                                                       VARCHAR2(300)
    L_NAME                                                                                       VARCHAR2(300)Anyone can help diagnose this please.
    Thanks
    Edited by: rsar001 on Feb 11, 2011 9:10 PM

    Thank you all for the great ideas, you have been extremely helpful. Here is what we did and were able to resolve the query.
    We started with Etbin's idea to create a table from the ext table so that we can index and reference easier than an external table, so we did the following:
    SQL> create table ext_person as select P_ID,ED_ID,trim(F_NAME) fst_name,trim(L_NAME) lst_name from EXT_NAMES_CSV;
    Table created.
    SQL> desc ext_person
    Name                                                                                Null?    Type
    P_ID                                                                                         NUMBER
    ED_ID                                                                                        NUMBER
    FST_NAME                                                                                     VARCHAR2(300)
    LST_NAME                                                                                     VARCHAR2(300)
    SQL> select count(*) from ext_person;
      COUNT(*)
         93383
    SQL> CREATE INDEX EXT_PERSON_ED ON ext_person (P_ID,ED_ID) TABLESPACE D_INDEX;
    Index created.
    SQL> exec dbms_stats.gather_index_stats(ownname=>'APPD', indname=>'EXT_PERSON_ED',partname=> NULL , estimate_percent=> 30 );
    PL/SQL procedure successfully completed.We had a look at the plan with the original SQL query that we had:
    SQL> explain plan for update temp_person
      2  set first_name = (select fst_name
      3                    from ext_person
      4                               where temp_person.PERSON_ID=ext_person.p_id
      5                               and   temp_person.DISTRICT_ID=ext_person.ed_id);
    Explained.
    SQL> @?/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    Plan hash value: 1236196514
    | Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT             |                | 93383 |  1550K|   186K (50)| 00:37:24 |
    |   1 |  UPDATE                      | TEMP_PERSON    |       |       |            |          |
    |   2 |   TABLE ACCESS FULL          | TEMP_PERSON    | 93383 |  1550K|   191   (1)| 00:00:03 |
    |   3 |   TABLE ACCESS BY INDEX ROWID| EXTT_PERSON    |     9 |  1602 |     1   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | EXT_PERSON_ED  |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("EXT_PERSON"."P_ID"=:B1 AND "RS_PERSON"."ED_ID"=:B2)
    Note
       - dynamic sampling used for this statement (level=2)
    20 rows selected.As you can see the time has dropped to 37min (from 6 hrs). Then we decided to change the SQL query and use donisback's suggestion (using MERGE); we explained the plan for teh new query and here is the results:
    SQL> explain plan for MERGE INTO temp_person t
      2  USING (SELECT fst_name ,p_id,ed_id
      3  FROM  ext_person) ext
      4  ON (ext.p_id=t.person_id AND ext.ed_id=t.district_id)
      5  WHEN MATCHED THEN
      6  UPDATE set t.first_name=ext.fst_name;
    Explained.
    SQL> @?/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    Plan hash value: 2192307910
    | Id  | Operation            | Name         | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | MERGE STATEMENT      |              | 92307 |    14M|       |  1417   (1)| 00:00:17 |
    |   1 |  MERGE               | TEMP_PERSON  |       |       |       |            |          |
    |   2 |   VIEW               |              |       |       |       |            |          |
    |*  3 |    HASH JOIN         |              | 92307 |    20M|  6384K|  1417   (1)| 00:00:17 |
    |   4 |     TABLE ACCESS FULL| TEMP_PERSON  | 93383 |  5289K|       |   192   (2)| 00:00:03 |
    |   5 |     TABLE ACCESS FULL| EXT_PERSON   | 92307 |    15M|       |    85   (2)| 00:00:02 |
    Predicate Information (identified by operation id):
       3 - access("P_ID"="T"."PERSON_ID" AND "ED_ID"="T"."DISTRICT_ID")
    Note
       - dynamic sampling used for this statement (level=2)
    21 rows selected.As you can see, the update now takes 00:00:17 to run (need to say more?) :)
    Thank you all for your ideas that helped us get to the solution.
    Much appreciated.
    Thanks

  • Hyperion Planning Web URL is taking Too long time to respond

    Hi,
    When Users are accessing Hyperion Planning URL web link its taking too long time to respond.We restarted the services after these for 2 hours it works fine after that again same issue.Please advise.

    Hi John,
    Follwing is the Log noted: when URL is slow:
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R com.hyperion.planning.olap.EssbaseException: ESSG_ERR_OPERATIONFAILED (1100027)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseGridAPI.HspSaveGrid(Native Method)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssGConnection.hspSaveGrid(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.loadOrSaveForm(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.saveForm(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.db.HspFMDBImpl.saveFormGrid(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.SaveFormGrid(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at HspEnterData.Handle(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at HspEnterData.doPost(Unknown Source)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:658)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
    [8/15/12 10:17:21:204 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R com.hyperion.planning.olap.EssbaseException: ESSG_ERR_OPERATIONFAILED (1100027)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseGridAPI.HspSaveGrid(Native Method)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssGConnection.hspSaveGrid(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.loadOrSaveForm(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.saveForm(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.db.HspFMDBImpl.saveFormGrid(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.SaveFormGrid(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at HspEnterData.Handle(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at HspEnterData.doPost(Unknown Source)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:658)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
    [8/15/12 10:17:21:220 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R com.hyperion.planning.olap.EssbaseException: ESSG_ERR_OPERATIONFAILED (1100027)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseGridAPI.HspSaveGrid(Native Method)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssGConnection.hspSaveGrid(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.loadOrSaveForm(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.saveForm(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.db.HspFMDBImpl.saveFormGrid(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.SaveFormGrid(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at HspEnterData.Handle(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at HspEnterData.doPost(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:658)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R com.hyperion.planning.HspRuntimeException: There was an error during the save process.
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.db.HspFMDBImpl.saveFormGrid(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.SaveFormGrid(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at HspEnterData.Handle(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at HspEnterData.doPost(Unknown Source)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:658)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
    [8/15/12 10:17:21:236 GMT+08:00] 00000019 SystemErr R      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R com.hyperion.planning.olap.EssbaseException: ESSG_ERR_OPERATIONFAILED (1100027)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseGridAPI.HspSaveGrid(Native Method)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssGConnection.hspSaveGrid(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.loadOrSaveForm(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.olap.HspEssbaseJniOlap.saveForm(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.db.HspFMDBImpl.saveFormGrid(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.SaveFormGrid(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.hyperion.planning.HyperionPlanningBean.Save(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at HspEnterData.Handle(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at HspEnterData.doPost(Unknown Source)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:658)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    [8/15/12 10:17:21:251 GMT+08:00] 00000019 SystemErr R      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)

  • Query taking too long when using bind variable

    Hi All,
    There is a query in our prod DB which runs very slow (approx 2 hours) when it uses Bind Variables (using JDBC thin client), and when i try passing the variable using TOAD/SQL developer it runs fine.
    Explain Plan for running Query
    SELECT STATEMENT ALL_ROWSCost: 146 Bytes: 379 Cardinality: 1                                                   
         21 SORT ORDER BY Cost: 146 Bytes: 379 Cardinality: 1                                              
              20 NESTED LOOPS Cost: 145 Bytes: 379 Cardinality: 1                                         
                   17 HASH JOIN Cost: 22 Bytes: 42,558 Cardinality: 123                                    
                        15 MERGE JOIN CARTESIAN Cost: 15 Bytes: 8,910 Cardinality: 27                               
                             12 FILTER                          
                                  11 NESTED LOOPS OUTER Cost: 9 Bytes: 316 Cardinality: 1                     
                                       8 NESTED LOOPS OUTER Cost: 8 Bytes: 290 Cardinality: 1                
                                            5 NESTED LOOPS Cost: 6 Bytes: 256 Cardinality: 1           
                                                 2 TABLE ACCESS BY GLOBAL INDEX ROWID TABLE GDP.GDP_FX_DEALS_INCREMENTOR Cost: 4 Bytes: 28 Cardinality: 1 Partition #: 9 Partition access computed by row location     
                                                      1 INDEX RANGE SCAN INDEX GDP.GDP_FX_DEALS_INC_IDX_01 Cost: 3 Cardinality: 1
                                                 4 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 2 Bytes: 228 Cardinality: 1      
                                                      3 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 1 Cardinality: 1
                                            7 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 2 Bytes: 34 Cardinality: 1           
                                                 6 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 1 Cardinality: 1      
                                       10 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_COUNTERPARTIES Cost: 1 Bytes: 26 Cardinality: 1                
                                            9 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.PK_CPTY Cost: 0 Cardinality: 1           
                             14 BUFFER SORT Cost: 14 Bytes: 448 Cardinality: 32                          
                                  13 TABLE ACCESS FULL TABLE GDP.GDP_CITIES Cost: 6 Bytes: 448 Cardinality: 32                     
                        16 TABLE ACCESS FULL TABLE GDP.GDP_AREAS Cost: 6 Bytes: 2,304 Cardinality: 144                               
                   19 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_PORTFOLIOS Cost: 1 Bytes: 33 Cardinality: 1                                    
                        18 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.PORTFOLIOS_KEY Cost: 0 Cardinality: 1                               
    Explain Plan for Slow Query
    Plan
    SELECT STATEMENT ALL_ROWSCost: 11,526,226 Bytes: 119,281,912 Cardinality: 314,728                                                   
         21 SORT ORDER BY Cost: 11,526,226 Bytes: 119,281,912 Cardinality: 314,728                                              
              20 HASH JOIN Cost: 11,510,350 Bytes: 119,281,912 Cardinality: 314,728                                         
                   2 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_PORTFOLIOS Cost: 1,741 Bytes: 177,540 Cardinality: 5,380                                    
                        1 INDEX FULL SCAN INDEX (UNIQUE) GDP.PORTFOLIOS_KEY Cost: 14 Cardinality: 5,380                               
                   19 HASH JOIN Cost: 11,507,479 Bytes: 87,932,495,360 Cardinality: 254,140,160                                    
                        3 TABLE ACCESS FULL TABLE GDP.GDP_AREAS Cost: 6 Bytes: 2,304 Cardinality: 144                               
                        18 MERGE JOIN CARTESIAN Cost: 11,506,343 Bytes: 18,602,733,930 Cardinality: 56,371,921                               
                             15 FILTER                          
                                  14 HASH JOIN RIGHT OUTER Cost: 3,930,405 Bytes: 556,672,868 Cardinality: 1,761,623                     
                                       5 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_COUNTERPARTIES Cost: 6,763 Bytes: 892,580 Cardinality: 34,330                
                                            4 INDEX FULL SCAN INDEX (UNIQUE) GDP.PK_CPTY Cost: 63 Cardinality: 34,330           
                                       13 HASH JOIN OUTER Cost: 3,923,634 Bytes: 510,870,670 Cardinality: 1,761,623                
                                            10 HASH JOIN Cost: 2,096,894 Bytes: 450,975,488 Cardinality: 1,761,623           
                                                 7 TABLE ACCESS BY GLOBAL INDEX ROWID TABLE GDP.GDP_FX_DEALS_INCREMENTOR Cost: 2,763 Bytes: 52,083,248 Cardinality: 1,860,116 Partition #: 14 Partition access computed by row location     
                                                      6 INDEX RANGE SCAN INDEX GDP.GDP_FX_DEALS_INC_IDX_01 Cost: 480 Cardinality: 334,821
                                                 9 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 1,734,205 Bytes: 8,320,076,820 Cardinality: 36,491,565      
                                                      8 INDEX FULL SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 104,335 Cardinality: 39,200,838
                                            12 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 1,733,836 Bytes: 1,331,145,696 Cardinality: 39,151,344           
                                                 11 INDEX FULL SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 104,335 Cardinality: 39,200,838      
                             17 BUFFER SORT Cost: 11,499,580 Bytes: 448 Cardinality: 32                          
                                  16 TABLE ACCESS FULL TABLE GDP.GDP_CITIES Cost: 4 Bytes: 448 Cardinality: 32                     
    How can I avoid that.
    Thanks

    Hello
    Could you reformat your execution plans because they aren't particularly readable. The forums allow you to preserve the formatting of code or output by putting the symbol {noformat}{noformat} before and after the section of text you want to preserve formatting for. 
    If you write
    {noformat}select * from v$version
    {noformat}
    it will be displayed asselect * from v$version
    So can you run this above statement and post the output here so we know the full oracle version you are working with?  And finally, it would be really helpful to see the query you are running.  When you say it runs fine in Toad, is that when you replace the bind variables with the values or are you also using bind variables in Toad?
    Cheers
    David                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Data Archive Script is taking too long to delete a large table

    Hi All,
    We have data archive scripts, these scripts move data for a date range to a different table. so the script has two parts first copy data from original table to archive table; and second delete copied rows from the original table. The first part is executing very fast but the deletion is taking too long i.e. around 2-3 hours. The customer analysed the delete query and are saying the script is not using index and is going into full table scan. but the predicate itself is the primary key, Please help... More info below
    CREATE TABLE "APP"."MON_TXNS"
       (    "ID_TXN" NUMBER(12,0) NOT NULL ENABLE,
        "BOL_IS_CANCELLED" VARCHAR2(1 BYTE) DEFAULT 'N' NOT NULL ENABLE,
        "ID_PAYER" NUMBER(12,0),
        "ID_PAYER_PI" NUMBER(12,0),
        "ID_PAYEE" NUMBER(12,0),
        "ID_PAYEE_PI" NUMBER(12,0),
        "ID_CURRENCY" CHAR(3 BYTE) NOT NULL ENABLE,
        "STR_TEXT" VARCHAR2(60 CHAR),
        "DAT_MERCHANT_TIMESTAMP" DATE,
        "STR_MERCHANT_ORDER_ID" VARCHAR2(30 BYTE),
        "DAT_EXPIRATION" DATE,
        "DAT_CREATION" DATE,
        "STR_USER_CREATION" VARCHAR2(30 CHAR),
        "DAT_LAST_UPDATE" DATE,
        "STR_USER_LAST_UPDATE" VARCHAR2(30 CHAR),
        "STR_OTP" CHAR(6 BYTE),
        "ID_AUTH_METHOD_PAYER" NUMBER(1,0),
        "AMNT_AMOUNT" NUMBER(23,0) DEFAULT 0,
        "BOL_IS_AUTOCAPTURE" VARCHAR2(1 BYTE) DEFAULT 'N' NOT NULL ENABLE,
        "ID_USE_CASE" NUMBER(4,0) NOT NULL ENABLE,
        "ID_AUTH_METHOD_PAYEE" NUMBER(2,0),
         CONSTRAINT "CKC_BOL_IS_CANCELLED_MON_TXNS" CHECK (BOL_IS_CANCELLED in ('Y','N')) ENABLE,
         CONSTRAINT "PK_MON_TXNS" PRIMARY KEY ("ID_TXN")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_INDEX"  ENABLE,
         CONSTRAINT "FK_MON_TXNS_CURRENCIES" FOREIGN KEY ("ID_CURRENCY")
          REFERENCES "APP"."CURRENCIES" ("ID_CURRENCY") ENABLE,
         CONSTRAINT "FK_MON_TXNS_TO_PAYER" FOREIGN KEY ("ID_PAYER")
          REFERENCES "APP"."CUSTOMERS" ("ID_CUSTOMER") ENABLE,
         CONSTRAINT "FK_MON_TXNS_TO_PAYEE" FOREIGN KEY ("ID_PAYEE")
          REFERENCES "APP"."CUSTOMERS" ("ID_CUSTOMER") ENABLE,
         CONSTRAINT "FK_MON_TXNS_REFERENCE_TXNS" FOREIGN KEY ("ID_TXN")
          REFERENCES "APP"."TXNS" ("ID_TXN") ENABLE,
         CONSTRAINT "FK_MON_TXNS_TO_PI_PAYER" FOREIGN KEY ("ID_PAYER_PI")
          REFERENCES "APP"."PIS" ("ID_PI") ENABLE,
         CONSTRAINT "FK_MON_TXNS_TO_PI_PAYEE" FOREIGN KEY ("ID_PAYEE_PI")
          REFERENCES "APP"."PIS" ("ID_PI") ENABLE,
         CONSTRAINT "FK_MON_TXNS_TO_AUTHMETHOD" FOREIGN KEY ("ID_AUTH_METHOD_PAYER")
          REFERENCES "APP"."AUTHENTICATION_METHODS" ("ID_AUTHENTICATION_METHOD") ENABLE,
         CONSTRAINT "FK_MON_TXNS_USE_CASE_ID" FOREIGN KEY ("ID_USE_CASE")
          REFERENCES "APP"."USE_CASES" ("ID_USE_CASE") ENABLE,
         CONSTRAINT "FK_MON_TXN_AUTH_PAYEE" FOREIGN KEY ("ID_AUTH_METHOD_PAYEE")
          REFERENCES "APP"."AUTHENTICATION_METHODS" ("ID_AUTHENTICATION_METHOD") ENABLE
      CREATE INDEX "APP"."IDX_MON_TXNS" ON "APP"."MON_TXNS" ("ID_PAYER")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_INDEX" ;
      CREATE INDEX "APP"."IDX_PAYEE_MON_TXNS" ON "APP"."MON_TXNS" ("ID_PAYEE")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_DATA" ;
      CREATE INDEX "APP"."IDX_PYE_PI_MON_TXNS" ON "APP"."MON_TXNS" ("ID_PAYEE_PI")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_DATA" ;
      CREATE INDEX "APP"."IDX_PYR_PI_MON_TXNS" ON "APP"."MON_TXNS" ("ID_PAYER_PI")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_DATA" ;
      CREATE INDEX "APP"."IDX_USE_CASE_MON_TXNS" ON "APP"."MON_TXNS" ("ID_USE_CASE")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_DATA" ;
      CREATE UNIQUE INDEX "APP"."PK_MON_TXNS" ON "APP"."MON_TXNS" ("ID_TXN")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "LARGE_INDEX" ;
    Data is first moved to table in schema3.OTW. and then we are deleting all the rows in otw from original table. below is the explain plan for delete
    SQL> explain plan for
      2  delete from schema1.mon_txns where id_txn in (select id_txn from schema3.OTW);
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2798378986
    | Id  | Operation              | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | DELETE STATEMENT       |            |  2520 |   233K|    87   (2)| 00:00:02 |
    |   1 |  DELETE                | MON_TXNS   |       |       |            |          |
    |*  2 |   HASH JOIN RIGHT SEMI |            |  2520 |   233K|    87   (2)| 00:00:02 |
    |   3 |    INDEX FAST FULL SCAN| OTW_ID_TXN |  2520 | 15120 |     3   (0)| 00:00:01 |
    |   4 |    TABLE ACCESS FULL   | MON_TXNS   | 14260 |  1239K|    83   (0)| 00:00:02 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    Please help,
    thanks,
    Banka Ravi

    'Best practice' is just what Oracle is already doing as you have already been told: DELETE FROM myTable WHERE myDate between myStart and Myend.
    Your use case is why many orgs elect to use partitioning and use that DATE column as the partition key. Then it is VERY FAST and VERY EASY to truncate or drop partitions that contain old data when you no longer need them.
    The other solution used is to quit waiting so long to delete data and then you don't have to delete large amounts at the same time. So instead of deleting data once a month delete it once a week or even every night. Then the number of rows being deleted will be much smaller and, if the stats are kept current, Oracle may decide to use the index.

  • Select query based on joining of tables from different database is taking too long

    Hi Team,
    Select query on table with millions of records is taking very long time. It took 50mins, the below query is joining on multiple table from two databases DB1.dbo.Table1 contains 100 million records and also Table3 and Table4 (of different database) might
    contain close to 1million records.
    Select T1.*
    From DB1.dbo.Table1 T1
    Join DB1.dbo.Table2 T2 on RTRIM(T1.Col3) = RTRIM(T2.Col3)
    Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
    Join Table3 U on CA.Col2 = U.Col2 AND RTRIM(T2.Col2) = U.Col3
    Where U.Col4 NOT IN ('A1', 'A2', 'A3', 'A4', 'A5', 'A6','A7','A8','A9')
    And (T1.flg IS NULL OR T1.flg = 'N')
    And LTRIM(RTRIM(T2.Col2)) NOT IN ('B1','B2')
    How can i improve the performance of this query. Actual thing is update the data in Db1.dbo.table1 based on the conditions but if the select is taking close to 1hr then update will take hours together. Indexes already implemented on all the tables.
    Thanks,
    Eshwar.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

    Thanks.
    Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
    This join is not working with spaces if Rtrim is not used.
    Thanks! Eshwar.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

  • Moving the 80 Million records from Conversion database to System Test database (Just for one transaction table) taking too long.

    Hello Friends,
    The background is I am working as conversion manager and we move the data from oracle to SQL Server using SSMA and then we will apply the conversion logic and then move the data to system test ,UAT and Production.
    Scenario:
    Moving the 80 Million records from Conversion database to System Test database (Just for one transaction table) taking too long. Both the databases are in the same server.
    Questions are…
    What is best option?
    IF we use the SSIS it’s very slow and taking 17 hours (some time it use to stuck and won’t allow us to do any process).
    I am using my own script (Stored procedure) and it’s taking only 1 hour 40 Min. I would like know is there any better process to speed up and why the SSIS is taking too long.
    When we move the data using SSIS do they commit inside after particular count? (or) is the Microsoft is committing all the records together after writing into Transaction Log
    Thanks
    Karthikeyan Jothi

    http://www.dfarber.com/computer-consulting-blog.aspx?filterby=Copy%20hundreds%20of%20millions%20records%20in%20ms%20sql
    Processing
    hundreds of millions records can be done in less than an hour.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • I have the converter to change pdf to word. Works sometime, other time says conversion is taking too long. Can I get what it has translated so I can use the parts?

    I have the converter to change pdf to word. Works sometime, other time says conversion is taking too long. Can I get what it has translated so I can use the parts?

    I would ask in the ExportPDF forum, Adobe ExportPDF (read only) (assuming that's the service to which you have subscribed). This is the Reader one.

  • Iam using 3015 network printer. while iam printing from word it is taking too long to print

    Respected sir,
    I am using 3015 printer.  when ever i give print it is taking too long time nearly 1 minute . there is no problem with the network

    Let's set a static IP address for the printer:
    - Print a Network Config Page from the front of the printer. Note the printer's IP address.
    - Type that IP address into a browser to reveal the printer's internal settings.
    - Choose the Networking tab, then Wireless along the left side, then the IPv4 tab.
    - On this screen you want to set a Manual IP. You need to set an IP address outside the range that the router automatically sets (called the DHCP range). You can find the DHCP range of the router using its internal settings page or in its manual. Use the CD that came with your router or type the router's IP address (ends in .1) into a browser.
    - Use 255.255.255.0 for the subnet (unless you know it is different, if so, use that)
    - Enter your router's IP (on the Network Config Page) for the gateway and first DNS. Leave the second one blank.
    - Click 'Apply'.
    Now, shut down the router and printer, start the router, wait, then start the printer.
    After this you may need to redo 'Add a Printer' using the new IP address.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Creating intermedia index is taking too long!!

    creating intermedia index is taking too long. then memory insufficient... system down.
    please help.
    platform: win2000 pro, oracle817
    linux redhat, oracle817

    Use CTX_OUTPUT_START_LOG() to begin logging index requests. Then create an index and see what's going on.
    o.

  • Query is taking too long to execute - contd

    I am unable to post the entire explain plan in one post as it exceeds maximum length.
    Please advise on how to post this.
    Previous post Link : Link: Query is taking too long to execute
    Regards,
    Sreekanth Munagala.
    Edited by: Sreekanth Munagala on Oct 27, 2009 8:31 AM
    Edited by: Sreekanth Munagala on Oct 27, 2009 8:34 AM

    Hi Tubby,
    Today i executed only the first query in the view and it took almost 2.5 hrs.
    Here is the explain plan for this query
    SQL> SET SERVEROUTPUT ON
    SQL> set linesize 200
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT                                                                                                                                                                                      
    | Id  | Operation                                        |  Name                         | Rows  | Bytes | Cost  |                                                                                     
    |   0 | SELECT STATEMENT                                 |                               |     1 |   766 |  2448 |                                                                                     
    |   1 |  TABLE ACCESS BY INDEX ROWID                     | PO_VENDORS                    |     1 |    13 |     3 |                                                                                     
    |*  2 |   INDEX UNIQUE SCAN                              | PO_VENDORS_U1                 |     1 |       |     2 |                                                                                     
    |   3 |  TABLE ACCESS BY INDEX ROWID                     | PO_VENDORS                    |     1 |    29 |     3 |                                                                                     
    |*  4 |   INDEX UNIQUE SCAN                              | PO_VENDORS_U1                 |     1 |       |     2 |                                                                                     
    |   5 |  VIEW                                            | POC_ASN_PICKUP_LOCATIONS_V    |     2 |  2426 |    17 |                                                                                     
    |   6 |   UNION-ALL                                      |                               |       |       |       |                                                                                     
    |   7 |    NESTED LOOPS                                  |                               |     1 |    85 |     4 |                                                                                     
    |   8 |     NESTED LOOPS                                 |                               |     1 |    78 |     4 |                                                                                     
    |*  9 |      TABLE ACCESS BY INDEX ROWID                 | PO_VENDOR_SITES_ALL           |     1 |    73 |     3 |                                                                                     
    |* 10 |       INDEX UNIQUE SCAN                          | PO_VENDOR_SITES_U2            |     1 |       |     2 |                                                                                     
    |* 11 |      INDEX UNIQUE SCAN                           | PO_VENDORS_U1                 |     1 |     5 |     1 |                                                                                     
    |* 12 |     INDEX UNIQUE SCAN                            | FND_TERRITORIES_TL_U1         |     1 |     7 |       |                                                                                     
    |  13 |    NESTED LOOPS                                  |                               |     1 |    91 |    13 |                                                                                     
    |  14 |     NESTED LOOPS                                 |                               |     1 |    84 |    13 |                                                                                     
    |  15 |      TABLE ACCESS BY INDEX ROWID                 | PO_VENDORS                    |     1 |    13 |     3 |                                                                                     
    |* 16 |       INDEX UNIQUE SCAN                          | PO_VENDORS_U1                 |     1 |       |     2 |                                                                                     
    PLAN_TABLE_OUTPUT                                                                                                                                                                                      
    |* 17 |      TABLE ACCESS BY INDEX ROWID                 | FND_LOOKUP_VALUES             |     1 |    71 |    10 |                                                                                     
    |* 18 |       INDEX RANGE SCAN                           | FND_LOOKUP_VALUES_U2          |    13 |       |     2 |                                                                                     
    |* 19 |     INDEX UNIQUE SCAN                            | FND_TERRITORIES_TL_U1         |     1 |     7 |       |                                                                                     
    |* 20 |  COUNT STOPKEY                                   |                               |       |       |       |                                                                                     
    |  21 |   TABLE ACCESS BY INDEX ROWID                    | MTL_SYSTEM_ITEMS_B            |     8 |   136 |    12 |                                                                                     
    |* 22 |    INDEX RANGE SCAN                              | MTL_SYSTEM_ITEMS_B_U1         |     8 |       |     3 |                                                                                     
    |* 23 |  COUNT STOPKEY                                   |                               |       |       |       |                                                                                     
    |  24 |   TABLE ACCESS BY INDEX ROWID                    | MTL_SYSTEM_ITEMS_B            |     8 |   288 |    12 |                                                                                     
    |* 25 |    INDEX RANGE SCAN                              | MTL_SYSTEM_ITEMS_B_U1         |     8 |       |     3 |                                                                                     
    |  26 |  TABLE ACCESS BY INDEX ROWID                     | FND_TERRITORIES_TL            |     1 |    24 |     2 |                                                                                     
    |* 27 |   INDEX UNIQUE SCAN                              | FND_TERRITORIES_TL_U1         |     1 |       |     1 |                                                                                     
    |  28 |  NESTED LOOPS                                    |                               |     1 |    40 |     5 |                                                                                     
    |  29 |   TABLE ACCESS BY INDEX ROWID                    | HZ_CUST_ACCOUNTS              |     1 |    11 |     3 |                                                                                     
    |* 30 |    INDEX UNIQUE SCAN                             | HZ_CUST_ACCOUNTS_U1           |     1 |       |     2 |                                                                                     
    |  31 |   TABLE ACCESS BY INDEX ROWID                    | HZ_PARTIES                    |     1 |    29 |     2 |                                                                                     
    |* 32 |    INDEX UNIQUE SCAN                             | HZ_PARTIES_U1                 |     1 |       |     1 |                                                                                     
    |  33 |  TABLE ACCESS BY INDEX ROWID                     | FND_TERRITORIES_TL            |     1 |    24 |     2 |                                                                                     
    |* 34 |   INDEX UNIQUE SCAN                              | FND_TERRITORIES_TL_U1         |     1 |       |     1 |                                                                                     
    |  35 |  TABLE ACCESS BY INDEX ROWID                     | FND_TERRITORIES_TL            |     1 |    24 |     2 |                                                                                     
    |* 36 |   INDEX UNIQUE SCAN                              | FND_TERRITORIES_TL_U1         |     1 |       |     1 |                                                                                     
    |* 37 |  COUNT STOPKEY                                   |                               |       |       |       |                                                                                     
    PLAN_TABLE_OUTPUT                                                                                                                                                                                      
    |* 38 |   TABLE ACCESS BY INDEX ROWID                    | ONTC_MTC_PROFORMA_HEADERS     |     1 |    21 |     3 |                                                                                     
    |* 39 |    INDEX RANGE SCAN                              | ONTC_MTC_PROFORMA_HEADERS_U2  |     1 |       |     2 |                                                                                     
    |  40 |  TABLE ACCESS BY INDEX ROWID                     | FND_TERRITORIES_TL            |     1 |    24 |     2 |                                                                                     
    |* 41 |   INDEX UNIQUE SCAN                              | FND_TERRITORIES_TL_U1         |     1 |       |     1 |                                                                                     
    |* 42 |  COUNT STOPKEY                                   |                               |       |       |       |                                                                                     
    |* 43 |   TABLE ACCESS BY INDEX ROWID                    | ONTC_MTC_PROFORMA_HEADERS     |     1 |    21 |     3 |                                                                                     
    |* 44 |    INDEX RANGE SCAN                              | ONTC_MTC_PROFORMA_HEADERS_U2  |     1 |       |     2 |                                                                                     
    |  45 |  SORT AGGREGATE                                  |                               |     1 |    39 |       |                                                                                     
    |  46 |   NESTED LOOPS OUTER                             |                               |     2 |    78 |  1828 |                                                                                     
    |* 47 |    TABLE ACCESS FULL                             | ONTC_MTC_PROFORMA_HEADERS     |     1 |    24 |  1825 |                                                                                     
    |  48 |    TABLE ACCESS BY INDEX ROWID                   | ONTC_MTC_PROFORMA_LINES       |     5 |    75 |     3 |                                                                                     
    |* 49 |     INDEX RANGE SCAN                             | ONTC_MTC_PROFORMA_LINES_PK    |    11 |       |     2 |                                                                                     
    |  50 |  NESTED LOOPS                                    |                               |     1 |   766 |  2448 |                                                                                     
    |  51 |   NESTED LOOPS                                   |                               |     1 |   761 |  2447 |                                                                                     
    |  52 |    NESTED LOOPS                                  |                               |     1 |   746 |  2445 |                                                                                     
    |  53 |     NESTED LOOPS                                 |                               |     1 |   694 |  2443 |                                                                                     
    |  54 |      NESTED LOOPS                                |                               |     1 |   682 |  2441 |                                                                                     
    |  55 |       NESTED LOOPS                               |                               |     1 |   671 |  2439 |                                                                                     
    |  56 |        NESTED LOOPS                              |                               |     1 |   612 |  2437 |                                                                                     
    |  57 |         NESTED LOOPS                             |                               |     1 |   600 |  2435 |                                                                                     
    |  58 |          NESTED LOOPS                            |                               |     1 |   575 |  2433 |                                                                                     
    PLAN_TABLE_OUTPUT                                                                                                                                                                                      
    |  59 |           NESTED LOOPS                           |                               |     1 |   552 |  2431 |                                                                                     
    |  60 |            NESTED LOOPS                          |                               |     1 |   533 |  2429 |                                                                                     
    |  61 |             NESTED LOOPS                         |                               |     1 |   524 |  2428 |                                                                                     
    |  62 |              NESTED LOOPS                        |                               |     1 |   455 |  2427 |                                                                                     
    |  63 |               NESTED LOOPS                       |                               |     1 |   429 |  2426 |                                                                                     
    |  64 |                NESTED LOOPS                      |                               |     1 |   389 |  2424 |                                                                                     
    |  65 |                 NESTED LOOPS                     |                               |     1 |   368 |  2422 |                                                                                     
    |  66 |                  NESTED LOOPS                    |                               |     1 |   308 |  2421 |                                                                                     
    |  67 |                   NESTED LOOPS                   |                               |     1 |   281 |  2419 |                                                                                     
    |  68 |                    NESTED LOOPS                  |                               |     1 |   253 |  2418 |                                                                                     
    |  69 |                     NESTED LOOPS                 |                               |     1 |   214 |  2416 |                                                                                     
    |  70 |                      NESTED LOOPS                |                               |    39 |  7371 |  2338 |                                                                                     
    |* 71 |                       TABLE ACCESS FULL          | RCV_SHIPMENT_HEADERS          |    39 |  5070 |  2221 |                                                                                     
    |* 72 |                       TABLE ACCESS BY INDEX ROWID| RCV_SHIPMENT_LINES            |     1 |    59 |     3 |                                                                                     
    |* 73 |                        INDEX RANGE SCAN          | RCV_SHIPMENT_LINES_U2         |     1 |       |     2 |                                                                                     
    |* 74 |                      TABLE ACCESS BY INDEX ROWID | PO_LINES_ALL                  |     1 |    25 |     2 |                                                                                     
    |* 75 |                       INDEX UNIQUE SCAN          | PO_LINES_U1                   |     1 |       |     1 |                                                                                     
    |* 76 |                     TABLE ACCESS BY INDEX ROWID  | PO_LINE_LOCATIONS_ALL         |     1 |    39 |     2 |                                                                                     
    |* 77 |                      INDEX UNIQUE SCAN           | PO_LINE_LOCATIONS_U1          |     1 |       |     1 |                                                                                     
    |* 78 |                    TABLE ACCESS BY INDEX ROWID   | PO_HEADERS_ALL                |     1 |    28 |     1 |                                                                                     
    |* 79 |                     INDEX UNIQUE SCAN            | PO_HEADERS_U1                 |     1 |       |       |                                                                                     
    PLAN_TABLE_OUTPUT                                                                                                                                                                                      
    |* 80 |                   TABLE ACCESS BY INDEX ROWID    | OE_ORDER_LINES_ALL            |     1 |    27 |     2 |                                                                                     
    |* 81 |                    INDEX UNIQUE SCAN             | OE_ORDER_LINES_U1             |     1 |       |     1 |                                                                                     
    |  82 |                  TABLE ACCESS BY INDEX ROWID     | OE_ORDER_HEADERS_ALL          |     1 |    60 |     1 |                                                                                     
    |* 83 |                   INDEX UNIQUE SCAN              | OE_ORDER_HEADERS_U1           |     1 |       |       |                                                                                     
    |* 84 |                 TABLE ACCESS BY INDEX ROWID      | HZ_CUST_SITE_USES_ALL         |     1 |    21 |     2 |                                                                                     
    |* 85 |                  INDEX UNIQUE SCAN               | HZ_CUST_SITE_USES_U1          |     1 |       |     1 |                                                                                     
    |* 86 |                TABLE ACCESS BY INDEX ROWID       | HZ_CUST_SITE_USES_ALL         |     1 |    40 |     2 |                                                                                     
    |* 87 |                 INDEX UNIQUE SCAN                | HZ_CUST_SITE_USES_U1          |     1 |       |     1 |                                                                                     
    |  88 |               TABLE ACCESS BY INDEX ROWID        | WSH_CARRIERS                  |     1 |    26 |     1 |                                                                                     
    |* 89 |                INDEX UNIQUE SCAN                 | WSH_CARRIERS_U2               |     1 |       |       |                                                                                     
    |* 90 |              TABLE ACCESS BY INDEX ROWID         | WSH_CARRIER_SERVICES          |     1 |    69 |     1 |                                                                                     
    |* 91 |               INDEX RANGE SCAN                   | WSH_CARRIER_SERVICES_N1       |     2 |       |       |                                                                                     
    |* 92 |             TABLE ACCESS BY INDEX ROWID          | WSH_ORG_CARRIER_SERVICES      |     1 |     9 |     1 |                                                                                     
    |* 93 |              INDEX RANGE SCAN                    | WSH_ORG_CARRIER_SERVICES_N1   |     1 |       |       |                                                                                     
    |  94 |            TABLE ACCESS BY INDEX ROWID           | HZ_CUST_ACCOUNTS              |     1 |    19 |     2 |                                                                                     
    |* 95 |             INDEX UNIQUE SCAN                    | HZ_CUST_ACCOUNTS_U1           |     1 |       |     1 |                                                                                     
    |* 96 |           TABLE ACCESS BY INDEX ROWID            | HZ_CUST_ACCT_SITES_ALL        |     1 |    23 |     2 |                                                                                     
    |* 97 |            INDEX UNIQUE SCAN                     | HZ_CUST_ACCT_SITES_U1         |     1 |       |     1 |                                                                                     
    |* 98 |          TABLE ACCESS BY INDEX ROWID             | HZ_CUST_ACCT_SITES_ALL        |     1 |    25 |     2 |                                                                                     
    |* 99 |           INDEX UNIQUE SCAN                      | HZ_CUST_ACCT_SITES_U1         |     1 |       |     1 |                                                                                     
    | 100 |         TABLE ACCESS BY INDEX ROWID              | HZ_PARTY_SITES                |     1 |    12 |     2 |                                                                                     
    PLAN_TABLE_OUTPUT                                                                                                                                                                                      
    |*101 |          INDEX UNIQUE SCAN                       | HZ_PARTY_SITES_U1             |     1 |       |     1 |                                                                                     
    | 102 |        TABLE ACCESS BY INDEX ROWID               | HZ_LOCATIONS                  |     1 |    59 |     2 |                                                                                     
    |*103 |         INDEX UNIQUE SCAN                        | HZ_LOCATIONS_U1               |     1 |       |     1 |                                                                                     
    |*104 |       INDEX RANGE SCAN                           | HZ_LOC_ASSIGNMENTS_N1         |     1 |    11 |     2 |                                                                                     
    | 105 |      TABLE ACCESS BY INDEX ROWID                 | HZ_PARTY_SITES                |     1 |    12 |     2 |                                                                                     
    |*106 |       INDEX UNIQUE SCAN                          | HZ_PARTY_SITES_U1             |     1 |       |     1 |                                                                                     
    | 107 |     TABLE ACCESS BY INDEX ROWID                  | HZ_LOCATIONS                  |     1 |    52 |     2 |                                                                                     
    |*108 |      INDEX UNIQUE SCAN                           | HZ_LOCATIONS_U1               |     1 |       |     1 |                                                                                     
    |*109 |    INDEX RANGE SCAN                              | HZ_LOC_ASSIGNMENTS_N1         |     1 |    15 |     2 |                                                                                     
    |*110 |   INDEX UNIQUE SCAN                              | HZ_PARTIES_U1                 |     1 |     5 |     1 |                                                                                     
    I will put the predicate information in another post.
    193 rows selected.
    SQL> spool offPlease suggest on how can we improve the performance.
    Regards,
    Sreekanth Munagala.

  • Query taking too long

    I am running a fairly complex query with several table joins
    and it is taking too long. What can I do to improve performance?
    Thanks.
    Frank

    Dan's first suggestion is key - if you are doing multiple
    table joins, you want to make sure your indexes are set up on your
    tables correctly. If you have access to the database, this should
    be your first step. Rationalize's stored procedure suggestion is
    also a great idea (again, if you have access to create and manage
    stored procedures on your DB).
    Other than than, most databases usually have some sort of SQL
    efficiency analysis tool. SQL server has one built into their Query
    Analyzer tool. I would recommend using something like that to
    streamline your SQL. Like Dan said, something as simple as the
    order of elements in your where clause might make a big
    difference.

  • Connect by taking too long

    Hello,
    I have a table "a" that has:
    left_id right_id type
    4 5 1
    4 6 1
    4 7 1
    5 9 2
    5 10 2
    5 11 2
    9 13 3
    13 14 4
    10 15 3
    QUERY:
    select left_id, right_id, type from
    a
    connect by left_id = prior right_id
    start with left_id = 4;
    Execution Plan
    Plan hash value: 2739023583
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 29 | 1131 | 18 (12)| 00:00:01 |
    |* 1 | CONNECT BY WITH FILTERING| | | | | |
    |* 2 | INDEX RANGE SCAN | a_PK | 5 | 65 | 3 (0)| 00:00:01 |
    | 3 | NESTED LOOPS | | 24 | 624 | 13 (0)| 00:00:01 |
    | 4 | CONNECT BY PUMP | | | | | |
    |* 5 | INDEX RANGE SCAN | a_PK | 5 | 65 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - access("LEFT_ID"=PRIOR "RIGHT_ID")
    2 - access("LEFT_ID"=4)
    5 - access("LEFT_ID"="connect$_by$_pump$_002"."prior right_id ")
    Is there a way to optimize the query?
    The query is taking too long.
    -Thanks
    Karthik
    Edited by: user3934098 on Nov 14, 2010 1:50 AM

    Here is the detailed explaination:
    Version: oracle 10g R2
    Create table statement:
    CREATE TABLE A
    "LEFT_ID" NUMBER(9,0) NOT NULL ENABLE,
    "RIGHT_ID" NUMBER(9,0) NOT NULL ENABLE,
    "TYPE" NUMBER(9,0) NOT NULL ENABLE,
    CONSTRAINT "A_PK" PRIMARY KEY ("LEFT_ID", "RIGHT_ID", "TYPE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "DATA" ENABLE,
    CONSTRAINT "A_FK1" FOREIGN KEY ("TYPE") REFERENCES "B" ("TYPE") ENABLE
    SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
    TABLESPACE "DATA" ;
    Insert statements:
    INSERT INTO A VALUES(4, 5, 1);
    INSERT INTO A VALUES(4, 6, 1);
    INSERT INTO A VALUES(4, 7, 1);
    INSERT INTO A VALUES(5, 9, 2);
    INSERT INTO A VALUES(5, 10, 2);
    INSERT INTO A VALUES(5, 11, 2);
    INSERT INTO A VALUES(9, 13, 3);
    INSERT INTO A VALUES(13, 14, 4);
    INSERT INTO A VALUES(10, 15, 3);
    INDEXES:
    CREATE UNIQUE INDEX "A_PK" ON "A" ("LEFT_ID", "RIGHT_ID", "TYPE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "DATA" ;
    QUERY:
    select left_id, right_id, type from
    a
    connect by left_id = prior right_id
    start with left_id = 4;
    THE table has 951053 rows
    The explain plan is:"
    Execution Plan
    Plan hash value: 2739023583
    Id Operation Name Rows Bytes Cost (%CPU) Time
    0 SELECT STATEMENT 29 1131 18 (12) 00:00:01
    * 1 CONNECT BY WITH FILTERING
    * 2 INDEX RANGE SCAN a_PK 5 65 3 (0) 00:00:01
    3 NESTED LOOPS 24 624 13 (0) 00:00:01
    4 CONNECT BY PUMP
    * 5 INDEX RANGE SCAN a_PK 5 65 2 (0) 00:00:01
    Predicate Information (identified by operation id):
    1 - access("LEFT_ID"=PRIOR "RIGHT_ID")
    2 - access("LEFT_ID"=4)
    5 - access("LEFT_ID"="connect$_by$_pump$_002"."prior right_id ")
    Now is there a way to optimize the query? The query takes about a min to excute. This will be my inner query.
    " Is there any other information that you may need? Am I missing something here? "
    -Thanks
    Karthik
    Edited by: user3934098 on Nov 14, 2010 2:22 AM

  • Oracle - Query taking too long (Materialized view)

    Hi,
    I am extracting billing informaiton and storing in 3 different tables... in order to show total billing (80 to 90 columns, 1 million rows per month), I've used a materialized view... I do not have indexes on 3 billing tables - do have 3 indexes on Materialized view...
    at the moment it's taking too long to query the data (running a query via toad fails and shows "Out of Memory" error message; runing a query via APEX though is providing results but taking way too long)...
    Please advice how to make the query efficient...

    tparvaiz,
    Is it possible when building your materialized view to summarize and consolidate the data?
    Out of a million rows, what would your typical user do with that amount data if they could retrieve it readily? The answer to this question may indicate if and how to summarize the data within the materialized view.
    Jeff
    Edited by: jwellsnh on Mar 25, 2010 7:02 AM

Maybe you are looking for

  • Sender channel FTP archive problems.

    Hi all, I'm trying to archive the file I upload from folder /xx/yy/filename.txt in folder /xx/yy/archive. In the Adapter monitor I can see that the archive is not succesful. It is trying to archive under /xx/yy/archive//xx/yy/filename.txt !!!!!! It l

  • Disconnecting built-in monitor - will external VGA allow higher resolution?

    I want to connect an external monitor to an iMac 17" FP G4. I was told that if I disconnect the built-in monitor (on the logic board), then I can get more than 1024x768 on the external mini-VGA port. I'm hoping that someone in the forums has done thi

  • PO item without charge

    Hello gurus, simple newbie question (I think): In our system there is a PO with GR. Now, the vendor tells us that he will not charge us for the delivered goods. Now, what is the correct thing to do in SAP to correct the commitments, GR/IR account etc

  • Bluetooth iPad and iPhone

    My iPad 3G and iPhone 4 can' t find each other. Have can I establish ling among them wireless ?

  • Will be possible to directly open *.stp (STEP-Files) in Photoshop CS6Extended?

    I know, the most programs for 3D can save geometry at least in one of the file format supported by PS. Nevertheless there are many occasions in which we have no choice: you get Step and nothing else. I know Acrobat 8 3D could read Step files direcly.