Inappropriate index used

Hi All,
I have a table with following structure initially without any data.
Name                                                  Null?    Type
DTL_MSG_ID                                            NOT NULL NUMBER(9)
MODULE_TYPE                                           NOT NULL VARCHAR2(2 CHAR)
MSG_ID                                                NOT NULL NUMBER(9)
WHSE                                                  NOT NULL VARCHAR2(3 CHAR)
MSG_TYPE                                                       VARCHAR2(10 CHAR)
MSG                                                            VARCHAR2(1000 CHAR)
MSG_OBJ                                                        BLOB
CREATE_DATE_TIME                                               DATE
MOD_DATE_TIME                                                  DATE
MISC1                                                          VARCHAR2(20 CHAR)
MISC2                                                          VARCHAR2(20 CHAR)
VERSION_ID                                            NOT NULL NUMBER(6)
Below is the list of index created on table columns.
SQL> select index_name,table_name,column_name,column_position from user_ind_columns where table_name='E_WMS_EVNT_MSG_DTL' order by 1,4;
INDEX_NAME                     TABLE_NAME                     COLUMN_NAME                              COLUMN_POSITION
E_WMS_EVNT_MSG_DTL_IND_1       E_WMS_EVNT_MSG_DTL             MSG_ID                                                 1
FK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             MSG_ID                                                 1
FK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             MODULE_TYPE                                            2
FK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             WHSE                                                   3
FK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             DTL_MSG_ID                                             4
PK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             DTL_MSG_ID                                             1
PK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             MODULE_TYPE                                            2
PK_E_WMS_EVNT_MSG_DTL          E_WMS_EVNT_MSG_DTL             WHSE                                                   3
8 rows selected.
Generate Explain plan using order by cluase in query
SQL> explain plan for SELECT wmsevntmsg0_.module_type AS module2_107_, wmsevntmsg0_.dtl_msg_id AS dtl1_107_, wmsevntmsg0_.msg_type AS msg5_107_, wmsevntmsg0_.msg AS msg107_, wmsevntmsg0_.msg_id AS msg4_107_, wmsevntmsg0_.msg_obj AS msg7_107_, wmsevntmsg0_.create_date_time AS create8_107_, wmsevntmsg0_.mod_date_time AS mod9_107_, wmsevntmsg0_.whse AS whse107_, wmsevntmsg0_.misc1 AS misc10_107_, wmsevntmsg0_.misc2 AS misc11_107_
  2  FROM e_wms_evnt_msg_dtl wmsevntmsg0_ WHERE wmsevntmsg0_.msg_id = :1 AND wmsevntmsg0_.module_type = :2 AND wmsevntmsg0_.whse = :3 ORDER BY wmsevntmsg0_.msg_id,wmsevntmsg0_.dtl_msg_id ASC
  3  ;
Plan is using the PK index to fetch data.
Plan hash value: 2070795294
| Id  | Operation                   | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT            |                       |   514 |   306K|  6425   (1)| 00:01:18 |
|*  1 |  TABLE ACCESS BY INDEX ROWID| E_WMS_EVNT_MSG_DTL    |   514 |   306K|  6425   (1)| 00:01:18 |
|*  2 |   INDEX FULL SCAN           | PK_E_WMS_EVNT_MSG_DTL |   253K|       |   177   (2)| 00:00:03 |
Explain plan without using Order by in query.
SQL> explain plan for SELECT wmsevntmsg0_.module_type AS module2_107_, wmsevntmsg0_.dtl_msg_id AS dtl1_107_, wmsevntmsg0_.msg_type AS msg5_107_, wmsevntmsg0_.msg AS msg107_, wmsevntmsg0_.msg_id AS msg4_107_, wmsevntmsg0_.msg_obj AS msg7_107_, wmsevntmsg0_.create_date_time AS create8_107_, wmsevntmsg0_.mod_date_time AS mod9_107_, wmsevntmsg0_.whse AS whse107_, wmsevntmsg0_.misc1 AS misc10_107_, wmsevntmsg0_.misc2 AS misc11_107_
FROM e_wms_evnt_msg_dtl wmsevntmsg0_ WHERE wmsevntmsg0_.msg_id = 115952 AND wmsevntmsg0_.module_type = '10' AND wmsevntmsg0_.whse = '61'  2  ;
I believe its now using the correct index to fetch data.
Plan hash value: 461238093
| Id  | Operation                   | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT            |                       |     1 |   611 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| E_WMS_EVNT_MSG_DTL    |     1 |   611 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN          | FK_E_WMS_EVNT_MSG_DTL |     1 |       |     1   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------------Please suggest, I am wondering why oracle using PK index in first scenario. Table has the updated stats.
Thanks in Advanced.
Bhupinder

Hi Oscar,
Thanks a lot for your reply.
But the problem here is why Oracle is not using the index I created for all the columns i WHERE condition, instead it is looking for data from Primary Key index.
Regards,
Bhupinder

Similar Messages

  • Error in Updating ctxsys.context index using ctxsrv

    Environment :
    Linux 6.2,
    Oracle 8.1.6
    character set : zhs16gbk or zhs16cgb231280
    I can create an ctxsys.context index(using CHINESE_VGRAM_LEXER) on a long column, and i can rebuild this index with no parameters.
    When i want to rebuild this index automatic using ctxsrv, this error occur ---
    DRG-50857 Oracle error in drtldml(dml)
    Ora-2000 error
    anybody can help me?
    null

    the complete error:
    Dml batch: cid=1023
    End batch: return code is 1
    DRG-50857: oracle error in drtldml(dml)
    ORA_20000: interMedia text 4mNs
    DRG-50857: oracle error in drsxsopen
    ORA-01480: STR83V51dA?H1IY?U:sW:
    null

  • When is a secondary index used (in select or where)

    HI All,
    We are confused (and new to ABAP) on the various postings on SDN concerning this topic.  Replies seem to vary.
    We have the following select statement:
    SELECT date1 FROM table2
    WHERE material (from a stored internal table) = material-table2
    AND order (from a stored internal table) = order-table2
    AND delivery method (from a stored internal table) = specific value of table2.
    For a second index to be created, would we create the index for only date1 (since it's the only field we are selecting from table 2) or an index with date1, material, order, delivery method or just what's in the WHERE clause of material, order and delivery method?
    How can you be sure that an index will be used?
    Thank you!

    > We are confused (and new to ABAP)
    seem you are very very new.
    Your question is actually not ABAP indexes etc are SQL and can be found in many textbooks also on Wiki pages. ABAP uses SQL, but does not change much.
    The use index is determined nearly only by the WHERE clause. You want to know the phone number of somebody and you know the name and the address. The Index uses the name and the address as a telephone book. The phone number comes from the table not the index! This is not the secondary index, but the primary index.
    If you search in the internet for phone number, then you can use also a secondary index, i.e. you know only the complete address but not the name. A phone book would not help here.
    Which index is used, if often very simple as in the example, but can become very difficult. That is done by a sophisticated program of the database, the optimizer. Check other resoucres for details.
    Siegfried

  • Error When Creating Oracle Text index using Lexer Keyword

    Hi All,
    I am getting following error when i creating oracle text index using lexer & stoplist keyword.
    Pls Help me if any body know.
    Thanks in Advance.
    Error starting at line 1 in command:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
    PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
    PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
    Error at Command Line:1 Column:13
    Error report:
    SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-11000: invalid keyword LEXER
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
    29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
    *Cause:    Failed to successfully execute the ODCIIndexCreate routine.
    *Action:   Check to see if the routine has been coded correctly.
    Regards,
    Jack R.

    Hi,
    it works if you put an extra PARAMETERS clause at the end so the creation looks like:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
    PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
    PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
    PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
    Hope this helps
    Herald ten Dam

  • ORA-29855 - Error creating Spatial Index using a Stored Procedure

    Hi
    I am using Oracle 10gR2 database and I have written a stored procedure to create spatial index. But when i execute this function i get the following error message.
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in R-tree: [mdrcrtscrt]
    ORA-13231: failed to create index table [MDRT_217C1$] during R-tree creation
    ORA-13249: Stmt-Execute Failure: CREATE TABLE FGDABZ40.MDRT_217C1$ (NODE_ID NUMBER, NODE_LEVEL NUMBER, INFO BLOB) LOB (INFO) STORE AS (CACHE) NOLOGGING PCTFREE 2
    ORA-29400: data cartridge error
    ORA-01031: insufficient privileges
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    ORA-06512: at line 1
    ORA-06512: at "FGDABZ40.PKG_PSSDBE_APPLICATION", line 298
    ORA-06512: at line 17
    The tables that i am passing are registered in metadata and I am able to create indexes directly in sql plus. But when i try to create using this stored procedure, it fails.
    it should be possible to create indexes using a generic function. Has any faced a similar problem?
    regards
    sam

    Hi,
    I am having a same error on Oracle 10gR2 database. When I execute the same statement in sqlplus, it works. But it gives this error when I call the procedure which has this create spatial index statement.
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in R-tree: [mdrcrtscrt]
    ORA-13231: failed to create index table [MDRT_20CDA$] during R-tree creation
    ORA-13249: Stmt-Execute Failure: CREATE TABLE "SDOMGR".MDRT_20CDA$ (NODE_ID NUMBER, NODE_LEVEL NUMBER, INFO BLOB) LOB (INFO) STORE AS (CACHE) NOLOGGING PCTFREE 2
    ORA-29400: data cartridge error
    ORA-01031: i
    Any help will be appreciated.
    Thanks,
    Sri

  • How to create a composite nonclustered index using sql server management studio

    Hi,
    How do I create a composite non clustered index using Manage Index and Keys dialogue box?
    sukai

    See image below:
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to create indexes using CREATE TABLE statement

    Hi,
    Can anyone please tell me how to create indexes using CREATE TABLE staement? This point is part SQL Expert exam (1Z0-047) and please guide me to use which books for this particular exam.
    Thanks in advance.

    Can anyone please tell me how to create indexes using CREATE TABLE staement?e.g. creating a primary key or a unique constraint will generate indexes along with the create table syntax:
    SQL> create table t (a integer primary key, b integer unique)
    Table created.
    SQL> select   index_name, index_type, uniqueness
      from   user_indexes
    where   table_name = 'T'
    INDEX_NAME                     INDEX_TYPE                  UNIQUENES
    SYS_C0016575                   NORMAL                      UNIQUE  
    SYS_C0016574                   NORMAL                      UNIQUE  
    2 rows selected.

  • Error When Creating OR Rebuilding Oracle Text index using Lexer Keyword

    Hi All,
    I am getting following error when i creating oracle text index using lexer & stoplist keyword.
    Pls Help me if any body know.
    Thanks in Advance.
    Error starting at line 1 in command:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
    PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
    PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
    Error at Command Line:1 Column:13
    Error report:
    SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-11000: invalid keyword LEXER
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
    29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
    *Cause:    Failed to successfully execute the ODCIIndexCreate routine.
    *Action:   Check to see if the routine has been coded correctly.
    Regards,
    Jack R.

    Hi,
    it works if you put an extra PARAMETERS clause at the end so the creation looks like:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
    PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
    PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
    PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
    PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
    Hope this helps
    Herald ten Dam

  • IE crash following intensive index use

    I created a small WebHelp project (95 topics) using RH 5.x.
    When I launch the project in IE (6.0.x) and try to use the compiled
    index, I find that clicking quickly on 6-7 entries in a row causes
    the browser to shut down. I can click all day, slow or fast, in the
    same index using Netscape or Firefox, without incident. Any
    thoughts on a possible cause? This sounds like the same problem
    that Bin.Chen reported on 9/27/06. That post generated no
    follow-ups so thought I'd risk a repeat.

    I just made a copy of a 271-topic project heavy on tables,
    with file names like acppd_format_ name_keys and in-topic
    references to these files, so they show up as text as well as file
    names. The Index Wizard picked up about 8,000 keywords.
    I did the index with a project setting for "Add keywords to"
    HHK and generated WebHelp.
    Then I discarded the HHK file and set "Add keywords to"
    Topics, created an index and generated WebHelp to a separate
    directory.
    The WebHelp output packages were substantially the same. The
    wizard picked up a few more keywords in the second pass, but this
    affected only a few output files. Their structure was the same,
    most counterpart files were the same, and the whxxx directories
    were only slightly larger the second time. They totaled just under
    4 MB. Are your whxxx directories a lot bigger?
    I put both versions up on a Dev sever and tried to make IE
    crash with rapid clicks in the Index. No crash.
    Overall, the second WebHelp package was only a little bigger,
    at about 6.25 MB.
    The only important difference was in the project folder. As I
    specified, Index terms were in the HHK file, or they were stored as
    Metadata in the source code (and only in the source files, not the
    output files).
    So I'm grasping at straws now.
    How big are your whxxx directories?
    Do you have any file names or index terms with strange
    characters, aside from - hyphen and _ underscore? Spaces, of
    course, are OK in the index but not in file names. How many layers
    deep are your topics? An unusually long link path, including a
    really long file name, can cause trouble elsewhere. I don't know
    whether these issues are relevant to index loading.
    One more thought.
    Try to find a Web site built with RH, with a substantial
    Index. See if the browser quits there. If not, I'd look more
    closely at your server.
    Regards,
    Harvey

  • Does rebuild of indexes uses temp tablespace or system tablespace?

    Does rebuild of indexes uses temp tablespace or system tablespace?
    If so why?

    If you combine the answers from Aman and Burleson, they cover most of the picture.
    When rebuilding an index, you may end up sorting a large amount of information. The sort may spill into the temporary tablespace - if you haven't configured your database and users properly, it is possible that the SYSTEM tablespace may be used for the temporary tablespace.
    As the new copy of the index is built, it has to be built in the right place (tablespace), and the space used to build it will be marked as a temporary segment as the build takes place. When the build is complete, this temporary segment will take on the name of the origrinal index, and the original index will be re-badged as a temporary segment and dropped. (Again, you might see temporary segments in the SYSTEM tablespace if the index was originally in, or was rebuilt into, the SYSTEM tablespace).
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • Invalid TLS index used for current stack trace.

    Post Author: KBenjamin
    CA Forum: Older Products
    In Visual Basic 6.0, when I run this line of code to create an instance of CR 8.5: Global G_objCRApplication As CRAXDRT.Application
    I get this error: Invalid TLS index used for current stack trace.
    How do I fix this?

    Hello Don,
    Crystal Reports 8.5 was retired long before Vista was released.  Mixing in other CRPE versions wouldn't be supported to work in your application.  Business Objects SAP won't go back and update earlier versions of Crystal Reports (like CR8.5) for Vista support.
    CR XI R2 with later service packs is supported on Vista, however using direct API calls (e.g. PEOpenEngine) was retired after CR9.  It is unlikely that you'll be able to upgrade your application to CRXIR2 without a major rewrite to move to the Report Designer Component (RDC).
    Note that CR2008 doesn't ship with the RDC.  The recommended upgrade path is to move to the .NET platform.
    Sincerely,
    Dan Kelleher

  • Patch 11072246  Addresses non-optimal index use

    Hi,
    on 11.2.0.3.0 on Win 2008
    the patch 11072246 Addresses non-optimal index use when an index column is in descending order.
    How can we know if we should apply this patch or not ?
    Until now no user has found a problem like this. Does it mean that we have not non-optimal index use at all ?
    thanks and regards.

    thank you. yes , 13965211 is superseded.
    But in 16774393 ( Windows Patch 20) , non-optimal index use when an index column is in descending order is not addressed.
    Regards.

  • Check Index used in an oracle select query

    Hi Friends,
    I have partitioned an oracle table and created Local Index for the Partitioned table .
    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?
    Please let me know.
    Regards,
    DB

    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.Why? Have you proven that using this local index is the "best" plan?
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?When I asked Google "how to read an oracle explain plan," I found lots of information - what did you find?

  • How to make an index use in a query execution

    Hi,
    I have the below query for which ename column has an index. As of my knowledge below queries 1st and 2st will not use index. Hence i used the 3rd statement and that too its not using the index. Finally i used the 4th query, but even the 4th query is not using the index. Then how do i make this query to use my index??? Do i need to create a function based index for this??? Is that the final option????
    1. select * from emp where ename !='BH' ;
    2. select * from emp where ename <> 'BH';
    3. select * from emp where ename not in ('BH');
    4. select * from emp where ename < 'BH' or ename > 'BH';
    Regards,
    007
    Edited by: 007 on Jun 6, 2013 7:56 AM
    Edited by: 007 on Jun 6, 2013 8:06 AM
    Edited by: 007 on Jun 6, 2013 8:06 AM
    Edited by: 007 on Jun 6, 2013 8:06 AM
    Edited by: 007 on Jun 6, 2013 8:12 AM

    Sorry 007, I really thought you were posting a trick question as on the OCP tests.
    Anyway, as Justin mentioned, if you have an index on ename, it may be used when doing a comparison predicate statement with the ename value.
    What it depends on are several other things: stats, how many rows in the table, use of an index hint, etc.
    Rather than questioning the group on this, why not just turn on autotrace and run the query for the different scenarios.
    The output will show you if it used the index, number of rows returned, blocks read, etc.
    SQL> create table emp (ename  varchar2(40));
    Table created.
    SQL> insert into emp select username from sys.dba_users;
    25 rows created.
    SQL> commit;
    Commit complete.
    SQL> set autotrace on
    SQL> select * from emp where ename != 'SYSTEM';
    Execution Plan
    Plan hash value: 2951343571
    | Id  | Operation        | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |           |    24 |   528 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX FULL SCAN | ENAME_IDX |    24 |   528 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("ENAME"<>'SYSTEM')As you can see, the above used an index, even though there were only 25 rows in the table.
    You can test each of your scenarios, one by one, including use of a hint.

  • Different query behaviour (index or no index use) between sql and pl/sql

    Hi All,
    I have a query inside a cursor in a procedure, let's say:
    cursor c_emp (b_dept_no in number)
    is
    select *
    from emp
    where dept_no = b_dep_no;
    There is an non unique index on dept_no.
    In this procedure i first loop through another cursor which gets the dept_no and with this dept_no i go into a for loop for the c_emp cursor.
    When i run this procedure i see that the explain plan of above query gives me a Full table Scan on EMP, eventhough there is a index on dept_no and there are 1.3 million records in the em table. When i take the above query and explain it seperately, it uses the index on dept_no.
    I have rebuild/analyzed the tables and indexes, nothing seems to work. Even hints in the procedure cursor are not helping at all.
    I'm using Oracle Database 10.2.0.1.0 and have never seen such behaviour before.
    Anyone an idea what is going on here?
    Kind regards,
    Dave

    Hoi Rob,
    it's like i have three tables. The first i have to get data from for my output, then for every record of table one there are one or more records in table 2 and table 3.
    I had to create a xml file and it looks like this:
    <Table1 Record 1>
    <Name>...</Name>
    etc...
    <Table2 Record 1>
    </Table2 Record 1>
    <Table2 Record 2>
    </Table2 Record 2>
    <Table3 Record 1>
    </Table3 Record 1>
    <Table3 Record 2>
    </Table3 Record 2>
    <Table1 Record 2>
    etc.etc.etc.
    So that's why i programmed:
    for r_1 in c_table1 loop
    for r_2 in c_table2(r_1.dept_no) loop
    end loop;
    for r_3 in c_table3(r_1.dept_no) loop
    end loop;
    end loop;
    And when i look at the first record,
    it has 2 records in table2 en 16 records in table3. So nothing huge.
    For now i'm unable to trace the session. I will try to post the tkprof later.
    Kind regards,
    Dave

Maybe you are looking for

  • Mapping proc output to vars gets error extracting result into a variable of type (DBTYPE_UI2)

    Hi, we run std 2012.  I have a proc (sets nocount on) whose params r shown in the first block .   My execute ssis sql task mapping is shown in the block following that (same order as shown, the param sizes are all -1).  The variable characteristics a

  • No User accounts after Archive and Install ?

    Today I tried to salvage a 20" iMac G5 for a friend. He had done something that screwed up his hard drive. Disk Utility Disk Repair run of the startup partition always failed. Using an external FW disk, I was able to use Disk Utility Repair successfu

  • Preview yellow triangle pictures before ordering a book

    Just for the record There has been some discussion about "how can I preview the file that is sent when I order a book", and how does it look different from the pictures when viewed in iPhoto. Go to share<email, and you'll get an email with that file,

  • Need Help !! Oracle Auditing

    Hi All, We are trying to turn On auditing for our Oracle Database(9i/10g). Requirement is to audit the insert/delete/update statements of the team members. So for every delete/update statement we would like to have the before image and after image of

  • HR Create Standalone Query Integrator - LOV as parameter type?

    Hi Our customer wants to download data from a view with filters on various fields. We accomplished this using a download integrator and created restrictions via Standalone Query with various where clause parameters to the view(using HR Create Standal