Structured XMLIndex is not used

I have a table defined as "TABLE OF XMLTYPE" with binary XML storage with a XMLIndex structured under Oracle 11.2.0.3.4. The query I use on this table is virtually identical to the XMLIndex, but it is not used. I searched the forums for similar issues and found this:

XMLIndex isn't getting used

However, the post is two years, and I think the solution was really specific to the problem. Not that mine is not. ;)
According to the guidelines of the forum, the data/DOF are confidential and should not be broadcast, so I opened an SR for it - SR 3-7160281751.

Can I please have some help to understand why the structured XMLIndex is not used?

Thank you...

Do you see something wrong?

Yes, path expressions are all wrong.
Do not begin the path with a slash unless the first step is the context item itself.

This point has been raised already in one of your previous thread: {message identifier: = 10930951}
>
No doubt you will become a few more errors during execution, some of them because of inconsistencies in path expressions, for example

idty:BOOK_INFO/idty:lang_code
//idty:BOOK_INFO/idty:BOOK_ENTR[child::idty:BOOK_REF=1]/idty:CATG_CODE
/idty:BOOK_INFO/idty:OUT_OF_STOCK_REAS

You've almost got it is right in the query, except for:

orig_ed_isbn_nbr VARCHAR2(64) PATH '/lclone:REFERENCES/lclone:PRINT[child::lclone:PRINT_TYP_CD="160"]/lclone:ISBN_NBR',
orig_ed_book_id VARCHAR2(64) PATH '/lclone:REFERENCES/lclone:PRINT[child::lclone:PRINT_TYP_CD="160"]/lclone:BOOK_ID'

Tags: Database

Similar Questions

  • Why xmlindex is not used in the slow queries on xml binary table eval?

    I run a slow simple query on Oracle 11.2.0.1 database server that does not use a xmlindex. Instead, a full table scan against the table eval binary xml occurs. This is the query:
     select -- /*+ NO_XMLINDEX_REWRITE no_parallel(eval)*/
          defid from eval,
          XMLTable(XMLNAMESPACES(DEFAULT 'http://www.cigna.com/acme/domains/eval/2010/03',
          'http://www.cigna.com/acme/domains/derived/fact/2010/03' AS "ns7"),
          '$doc/eval/derivedFacts/ns7:derivedFact' passing eval.object_value as "doc" columns defid varchar2(100) path 'ns7:defId'
           ) eval_xml
    where eval_xml.defid in ('59543','55208'); 
    The predicate is not selective at all - the number of rows returned is the same as the number of rows in table (325 550 in the eval table xml documents). When different values are used, which brings the number of lines down to ~ 33%, the xmlindex still is not used - as is expected in a purely relational XML environment.

    My question is why would'nt the xmlindex be used somehow full scan compared to a sweep of full table that cross the xml for each record in paper table eval?
    FFS suspicion would apply to a field of type xmlindex index?

    Here is the definition of xmlindex:
     CREATE INDEX "EVAL_XMLINDEX_IX" ON "EVAL" (OBJECT_VALUE)
      INDEXTYPE IS "XDB"."XMLINDEX" PARAMETERS
      ('XMLTable eval_idx_tab XMLNamespaces(DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03'',
      ''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7"),''/eval'' 
           COLUMNS defId VARCHAR2(100) path ''/derivedFacts/ns7:derivedFact/ns7:defId''');
    Here is the definition of table eval:
     CREATE
      TABLE "N98991"."EVAL" OF XMLTYPE
      (
        CONSTRAINT "EVAL_ID_PK" PRIMARY KEY ("EVAL_ID") USING INDEX PCTFREE 10
        INITRANS 4 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 "ACME_DATA" ENABLE
      )
      XMLTYPE STORE AS SECUREFILE BINARY XML
      (
        TABLESPACE "ACME_DATA" ENABLE STORAGE IN ROW CHUNK 8192 CACHE NOCOMPRESS
        KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS
        2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
        CELL_FLASH_CACHE DEFAULT)
      )
      ALLOW NONSCHEMA ALLOW ANYSCHEMA VIRTUAL COLUMNS
      (
        "EVAL_DT" AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
        SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03"; (::)
    /eval/@eval_dt'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
    WITH
      TIME ZONE))),
        "EVAL_CAT" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@category'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        "ACME_MBR_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@acmeMemberId'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        "EVAL_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@evalId'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50)))
      )
      PCTFREE 0 PCTUSED 80 INITRANS 4 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 "ACME_DATA" ; 
    Purified sample extract of XML:
    <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?><eval createdById="xxxx" hhhhMemberId="37e6f05a-88dc-41e9-a8df-2a2ac6d822c9" category="eeeeeeee" eval_dt="2012-02-11T23:47:02.645Z" evalId="12e007f5-b7c3-4da2-b8b8-4bf066675d1a" xmlns="http://www.xxxxx.com/vvvv/domains/eval/2010/03" xmlns:ns2="http://www.cigna.com/nnnn/domains/derived/fact/2010/03" xmlns:ns3="http://www.xxxxx.com/vvvv/domains/common/2010/03">
       <derivedFacts>
          <ns2:derivedFact>
             <ns2:defId>12345</ns2:defId>
             <ns2:defUrn>urn:mmmmrunner:Medical:Definition:DerivedFact:52657:1</ns2:defUrn>
             <ns2:factSource>tttt Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:47:02.645Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52600</ns2:defId>
             <ns2:defUrn>urn:ddddrunner:Medical:Definition:DerivedFact:52600:2</ns2:defUrn>
             <ns2:factSource>cccc Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:47:02.645Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>null</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>59543</ns2:defId>
             <ns2:defUrn>urn:ddddunner:Medical:Definition:DerivedFact:52599:1</ns2:defUrn>
             <ns2:factSource>dddd Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:47:02.645Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>INT</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
                    ...
                With the repeating <ns2:derivedFact> element continuing under the <derivedFacts>
    Oracle XML DB 11g Release 2 Developer's Guide is not much help...

    Any help is appreciated.

    Kind regards
    Rick Blanchard

    XMLIndex definition is not correct, for the following reasons:

    In the COLUMNS clause, the path expression is compared to the context from the main event of XQuery item (HERE "/ eval").
    If you use an initial slash as you did, this indicates that the context item is an element of "derivedFacts" (which is not correct since it is an "eval" element).
    Therefore, the path points to no existing node:

    derivedFact XMLTYPE path ''/derivedFacts/ns7:derivedFact'' virtual
    

    There is a mismatch between the statements of prefix ns7, probably a typing mistake?

    ''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7"
    ...
    ''http://www.cigna.com/acme/domains/derived/FACT/2010/03'' AS "ns7"
    

    What "eval_xml" is referring to here?

    passing eval_xml.derivedFact
    

    The path to "defId" don't go too:

    defId VARCHAR2(100) path ''/derivedFacts/ns7:derivedFact/ns7:defId''
    

    Try this one, it should help you to:

    CREATE INDEX "EVAL_XMLINDEX_IX" ON "EVAL" (OBJECT_VALUE)
    INDEXTYPE IS "XDB"."XMLINDEX" PARAMETERS (
    'XMLTable eval_idx_tab_I
      XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
                    DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),
      ''/eval''
      COLUMNS
       eval_catt   VARCHAR2(50) path ''@category'',
       derivedFact XMLTYPE      path ''derivedFacts/ns7:derivedFact'' virtual
     XMLTable eval_idx_tab_II
      XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
                    DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),
      ''/ns7:derivedFact'' passing derivedFact
      COLUMNS
       defId VARCHAR2(100) path ''ns7:defId'''
    );
    
  • Structured XMLIndex not used by the query

    Hello

    We try to use XMLIndexes structured for a query. But they are not used. A sample of similar work is as follows:


    -Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    Example of XML data on the XMLTYPE column is:

    <?xml version="1.0" encoding="UTF-8" standalone='yes'?>  
    <abc:tagOne preparationTime="2012-10-17T13:01:23.000Z" schemaVersion="1.3.9.0" xsi:schemaLocation="" xmlns:def="DEF" xmlns:abc="ABC"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  
        <def:tagTwo>  
            <def:tagThree id="Identity1">  
                <def:Section domain="Domain123">10000</def:Section>  
            </def:tagThree>  
            <def:tagThree id="Identity2">  
                <def:Section domain="Domain123">20000</def:Section>  
            </def:tagThree>  
            <def:tagThree id="Identity3">  
                <def:Section domain="Domain123">30000</def:Section>  
            </def:tagThree>  
            <def:tagThree id="Identity4">  
                <def:Section domain="Domain123">40000</def:Section>  
            </def:tagThree>  
        </def:tagTwo>  
    </abc:tagOne>
    
    
    
    
    



    Query is like:

    select  XMLAGG(XML_MESSAGE)  
        from INT_PART_TABLE  
        where XMLExists('  
            declare namespace abc="ABC";  
            declare namespace def="DEF";  
            $Message/abc:tagOne/def:tagTwo/def:tagThree[@id="Identity4"][def:Section[@domain="Domain123"]  = ("50000", "40000") ]'  
            passing  
            xML_mESSAGE as "Message"  
        )
    
    
    
    
    


    We try to create indexes structured on the column of xmltype, as defined in the XML example file:

    CREATE INDEX INT_PART_TABLE_SXI
       ON INT_PART_TABLE (XML_MESSAGE)
       INDEXTYPE IS XDB.XMLINDEX
          PARAMETERS ('XMLTABLE INT_PART_content_table_01
                               XMLNAMESPACES (''ABC'' AS "abc",
                                              ''DEF'' AS "def"),  
                               ''/abc:tagOne/def:tagTwo''
                       COLUMNS
                         xmltagTwo      XMLTYPE  PATH ''/abc:tagOne/def:tagTwo''  VIRTUAL
                       XMLTABLE INT_PART_content_table_02
                         XMLNAMESPACES (''DEF'' AS "def"),
                         ''/def:tagTwo''
                                PASSING xmltagTwo
                                 COLUMNS 
                                 xmltagThree     XMLTYPE  PATH ''/def:tagThree''   VIRTUAL
                       XMLTABLE INT_PART_content_table_03
                          XMLNAMESPACES (''DEF'' AS "def"),    
                          ''/def:tagThree''
                             PASSING xmltagThree
                               COLUMNS 
                               section number PATH ''def:Section'',
                               domain varchar2(20) PATH ''@domain'',
                               id varchar2(20) PATH ''@id''
                  ')local;
    
    
    
    
    

    Table structure:

    CREATE TABLE INT_PART_TABLE
    (
       DB_ID            VARCHAR2 (10 BYTE),
       xML_mESSAGE      SYS.XMLTYPE,
       LOAD_TIMESTAMP   TIMESTAMP (6)
    )
    XMLTYPE xML_mESSAGE
       STORE AS BINARY XML
       (ENABLE STORAGE IN ROW
        CHUNK 16384
        RETENTION
        CACHE READS NOLOGGING)
       ALLOW NONSCHEMA
       DISALLOW ANYSCHEMA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (BUFFER_POOL DEFAULT)
    PARTITION BY RANGE (LOAD_TIMESTAMP)
       (PARTITION P_12092012 VALUES LESS THAN (TIMESTAMP ' 2012-09-12 00:00:00')
           LOGGING
           NOCOMPRESS
           PCTFREE 10
           INITRANS 1
           MAXTRANS 255
           STORAGE (INITIAL 512 K
                    NEXT 512 K
                    MINEXTENTS 1
                    MAXEXTENTS UNLIMITED
                    PCTINCREASE 0
                    BUFFER_POOL DEFAULT),
        PARTITION MAX VALUES LESS THAN (MAXVALUE)
           LOGGING
           NOCOMPRESS
           PCTFREE 10
           INITRANS 2
           MAXTRANS 255
           STORAGE (INITIAL 128 K
                    NEXT 128 K
                    MINEXTENTS 1
                    MAXEXTENTS UNLIMITED
                    PCTINCREASE 0
                    BUFFER_POOL DEFAULT))
    PARALLEL (DEGREE 8 INSTANCES 1);
    
    
    
    
    

    - But the query above does not use the XMLINDEX STRUCTURE and instead turns to FTS INT_PART_TABLE.  Please help here.

    Is it the wrong way I created structured Index.

    (I tried a few other ways where I got-> ORA-19279: XPTY0004 - dynamic XQuery type mismatch: expected - singleton sequence got several sequence element).

    S ' Please NOTE that I used two "VIRTUAL" during the creation of the Index as otherwise I was getting the error:
    ORA-29958: fatal error occurred in the execution of routine ODCIINDEXCREATE
    ORA-30984: the XMLType column must be declared as virtual

    Please suggest. Thank you.

    Finally some time to watch this...

    The following works for me:

    Connected to:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > create table (int_part_table)

    2 db_id varchar2 (10 byte)

    3, xml_message xmltype

    4, load_timestamp timestamp (6)

    5)

    store xml_message 6 xmltype to the binary xml format

    7 partition by range (load_timestamp)

    () 8

    9 lower values p_12092012 partition to (to_timestamp ('2012-09-12 00:00:00 ',' YYYY-MM-DD HH24:MI:SS'))))

    10, partition p_max values less than (maxvalue)

    11)

    12 parallel (degree 8 instances 1);

    Table created.

    SQL > create index int_part_table_sxi on int_part_table (xml_message)

    2 indextype is xdb.xmlindex

    3 rooms

    4 parameters (q'~)

    5 XMLTABLE int_part_content_table_01

    6 XMLNAMESPACES ('ABC' AS 'abc', 'DEF' AS 'def'),

    7 ' / abc: Tallet / def:tagTwo / def:tagThree'

    8 COLUMNS

    9 article binary_double PATH 'def:Section '.

    10, area varchar2 (20) PATH 'def:Section/@domain '.

    11, id varchar2 (20) PATH '@id '.

    12 ~');

    The index is created.

    SQL >

    SQL >

    SQL > insert into int_part_table values)

    2 '1'

    3, xmltype (')

    4

    ' NS:ABC = 'ABC' xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" > ".

    5

    6

    7              10000

    8

    9

    10 20000

    11

    12

    13 30000

    14

    15

    16 40000

    17

    18

    19 ')

    20, systimestamp

    (21);

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > exec dbms_stats.gather_table_stats (user, 'INT_PART_TABLE');

    PL/SQL procedure successfully completed.

    SQL >

    SQL >

    SQL > set autotrace traceonly explain

    SQL > set lines 200

    SQL > define pages 100

    SQL >

    SQL > select / * + no_parallel * / xml_message

    2 of int_part_table

    3 where (XMLExists)

    4 ' declare namespace abc = "ABC"; (::)

    5 declare def namespace = "DEF"; (::)

    /ABC:tagOne/def:tagTwo/def:tagThree[@ID="Identity4 6 '.

    7 and def:Section/@domain="Domain123.

    8 and (def:Section = 40000

    9 or def:Section = 50000)]"

    10 passage xml_message

    11        ) ;

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 3112612945

    ---------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                      | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ---------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                           |     1.   417.    15 (0) | 00:00:01 |       |       |

    |   1.  SEMI NESTED LOOPS.                           |     1.   417.    15 (0) | 00:00:01 |       |       |

    |   2.   RANGE OF PARTITION ALL THE |                           |     1.   367.    14 (0) | 00:00:01 |     1.     2.

    |   3.    TABLE ACCESS FULL | INT_PART_TABLE |     1.   367.    14 (0) | 00:00:01 |     1.     2.

    |   4.   ITERATOR SYSTEM PARTITION.                           |     1.    50.     1 (0) | 00:00:01 |   KEY |   KEY |

    |*  5 |    TABLE ACCESS BY LOCAL INDEX ROWID | INT_PART_CONTENT_TABLE_01 |     1.    50.     1 (0) | 00:00:01 |   KEY |   KEY |

    |*  6 |     INDEX RANGE SCAN | SYS78560_78563_RID_IDX |     1.       |     0 (0) | 00:00:01 |   KEY |   KEY |

    ---------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    5 - filter("SYS_SXI_0".") ID "="Identity4"AND ("SYS_SXI_0"". ")" SECTION "IS 4.0E + 004 D OR 'SYS_SXI_0'." SECTION "(= 5.0E + 004 D) AND"

    'SYS_SXI_0 '. ("DOMAIN"="Domain123")

    6 - access ("INT_PART_TABLE". ROWID = "SYS_SXI_0." ("' RID ')

    filter (TBL$ OR$ IDX$ PART$ NUM ("DEV".) "INT_PART_TABLE", 0,0,0, "INT_PART_TABLE". ROWID) TBL = $ OR$ IDX$ PART$ NUM ("DEV". "INT_PAR

    T_CONTENT_TABLE_01", 0,0,0,"SYS_SXI_0. " ROWID))

    A few things to know:

    -use BINARY_DOUBLE datatype to untyped (i.e. not based on a diagram) the numerical values of the XML index.

    -J' developed the sequence iterator predicate you were using for a Boolean expression GOLD. Otherwise, the index is not used as intended.

    You can also create a secondary index that satisfies the predicate #5 (see red part above):

    SQL > create index int_part_content_table_01_ix1

    2 on local int_part_content_table_01 (id, field, section);

    The index is created.

    SQL >

    SQL > select / * + no_parallel * / xml_message

    2 of int_part_table

    3 where (XMLExists)

    4 ' declare namespace abc = "ABC"; (::)

    5 declare def namespace = "DEF"; (::)

    /ABC:tagOne/def:tagTwo/def:tagThree[@ID="Identity4 6 '.

    7 and def:Section/@domain="Domain123.

    8 and (def:Section = 40000

    9 or def:Section = 50000)]"

    10 passage xml_message

    11        ) ;

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 3704965392

    --------------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                          | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    --------------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                               |     1.   417.     4 (25) | 00:00:01 |       |       |

    |   1.  NESTED LOOPS |                               |     1.   417.     4 (25) | 00:00:01 |       |       |

    |   2.   UNIQUE FATE |                               |     2.   100.     2 (0) | 00:00:01 |       |       |

    |   3.    SYSTEM PARTITION ALL |                               |     2.   100.     2 (0) | 00:00:01 |     1.     2.

    |   4.     TABLE ACCESS BY LOCAL INDEX ROWID | INT_PART_CONTENT_TABLE_01 |     2.   100.     2 (0) | 00:00:01 |     1.     2.

    |*  5 |      INDEX RANGE SCAN | INT_PART_CONTENT_TABLE_01_IX1 |     1.       |     1 (0) | 00:00:01 |     1.     2.

    |*  6 |   TABLE ACCESS BY ROWID USER | INT_PART_TABLE |     1.   367.     1 (0) | 00:00:01 | ROWID | ROWID |

    --------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    5 - access("SYS_SXI_0".") ID '= 'Identity4' AND 'SYS_SXI_0'." DOMAIN "=" Domain123 ")

    filter ("SYS_SXI_0". "SECTION"IS 4.0E + 004 D OR 'SYS_SXI_0'." SECTION "(= 5.0E + 004 D)"

    6 filter (TBL$ OR$ IDX$ PART$ NUM ("DEV".) "INT_PART_TABLE", 0,0,0, "INT_PART_TABLE". ROWID) TBL = $ OR$ IDX$ PART$ NUM ("DEV". "INT_PART_CON

    TENT_TABLE_01", 0,0,0,"SYS_SXI_0. " ROWID))

  • FBI and XMLINDEX not use by the optimizer

    Hello

    I've created a function based index but optimizer is never using my index and found for BINARYXML FBI is not suggested rather THAN XMLINDEX is good, it seems does not work for me, but even.

    I tried to use tips but doesn't help me at all. Any suggestions would be really useful.

    SQL > show parameter index

    VALUE OF TYPE NAME
    ------------------------------------ ----------- ------------------------------
    optimizer_index_caching integer 0
    OPTIMIZER_INDEX_COST_ADJ integer 1
    optimizer_use_invisible_indexes boolean FALSE
    skip_unusable_indexes Boolean TRUE
    SQL >

    SQL > desc FXXX_SEC_POS_FB
    Name                                                                                  Null?    Type
    ------------------------------------------------------------------------------------- -------- ----------------------------------------------------------
    RECID A NOT NULL VARCHAR2 (255)
    XMLRECORD                                                                                      SYS. XMLTYPE BINARY STORAGE

    SQL >

    SQL * more: Production release 11.2.0.4.0 Wed Feb 11 06:34:39 2015

    Copyright (c) 1982, 2013, Oracle.  All rights reserved.


    Connected to:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    INDEX_NAME INDEX_TYPE VISIBILITY FUNCIDX_ DOMIDX_MANAGEM
    ------------------------------ --------------------------- --------- -------- --------------
    SYS_IL0000174507C00003$ $ LOB VISIBLE
    BASED ON A NORMAL VISIBLE ENABLED FUNCTION IX_FBNK_SEC_POS_FB_C2
    BASED ON A NORMAL VISIBLE ENABLED FUNCTION IX_FBNK_SEC_POS_FB_C81

    SELECT t.RECID FROM FBNK_SEC_POS_FB WHERE SECURITY_NUMBER = t'000566-000' and xmlexists ("$xmlrecvar/row [c81/text () ="US0010001"]' by the WAY ')

    XMLRECORD AS 'xmlrecvar')

    The higher the SQL statement execution Plan:

    Hash value of plan: 4259655978

    --------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    --------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |                 |   361K |   738 M |   197K (2) | 00:39:31 |
    |   1.  SEMI NESTED LOOPS.                 |   361K |   738 M |   197K (2) | 00:39:31 |
    |*  2 |   TABLE ACCESS FULL | FBNK_SEC_POS_FB |  4427 |  9247K |  75786 (1) | 00:15:10 |
    |*  3 |   XPATH EVALUATION.                 |       |       |            |          |
    --------------------------------------------------------------------------------------

    Name of the query block / Alias object (identified by the operation identity card):
    -------------------------------------------------------------

    1 SALT$ BCF67709
    2 SALT$ BCF67709 / T@SEL$1

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    2 - filter("SECURITY_NUMBER"='000566-000')
    3 - filter("P".") C_01$ "= 'US0010001')

    Projection of the column information (identified by the operation identity card):
    -----------------------------------------------------------

    1 (#keys = 0) "T". "RECID" [VARCHAR2, 255], "T" "." " SYS_NC00003$ '[LOB, 4000],
    "SECURITY_NUMBER" [VARCHAR2, 12]
    2 - « T ». "RECID" [VARCHAR2, 255], "T" "." " SYS_NC00003$ '[LOB, 4000],
    "SECURITY_NUMBER" [VARCHAR2, 12]
    3 VALUE (A0) [4000]

    Note
    -----
    -dynamic sample used for this survey (level = 2)
    LETTER: SQL: 2:Full: SELECT t.RECID FROM FBNK_SEC_POS_FB WHERE SECURITY_NUMBER = t'000566-000' and xmlexists (' $xmlrecvar/row [c81 / text ()])

    (= "US0010001"]' in PASSING XMLRECORD AS 'xmlrecvar')

    4096 selected records

    You probably won't see the difference in approach...

    I have NOT used and not STRUCTURED XML, but a STRUCTURED index rather XML index...

    • Index unstructured XML when introduced in 11.1 and use an ARRAY of path. Unstructured XML indexes are mainly used for research "blurred".
    • Structured XML indexes where introduced in 11.2 and make use of one or more TABLES of CONTENTS that contain, must contain content of the structured parts in the XML document

    So I have not used

    CREATE INDEX IX_FXXX_AAA_BBB_FB_FB
    ON FXXX_AAA_BBB_FB (XMLRECORD)
    INDEXTYPE IS XDB.XMLINDEX
    PARAMETERS ('  PATH TABLE IX_PATH_TABLE
                    PATHS (  INCLUDE ( /row/c2 /row/c81 ))'
                );
    

    but instead I used a XML structured, based on the function XMLTABLE index

    CREATE INDEX IX_FXXX_AAA_BBB_FB_FB
      ON FXXX_AAA_BBB_FB (XMLRECORD)
    INDEXTYPE IS XDB.XMLINDEX
      PARAMETERS (q'# GROUP SXI_GROUP
                      XMLTABLE SXI_CONTENT_TABLE
                      '/row'
                      COLUMNS
                        C2  VARCHAR2(100)     PATH 'c2'
                      , C81 VARCHAR2(100)     PATH 'c81'
                    #');
    

    On those, I also created EXTRA build secondary indexes on the columns of the TABLE CONTENT with the name 'SXI_CONTENT_TABLE '.

    create index SEC_FXXX_C2_FB on SXI_CONTENT_TABLE(C2);
    create index SEC_FXXX_C81_FB on SXI_CONTENT_TABLE(C81);
    create unique index SEC_FXXX_RIDC2C81_FB on SXI_CONTENT_TABLE(RID, C2, C81);
    

    ...

  • Why don't XMLIndex not used in slow queries against an XMLType Table?

    We have a slow queries based on XML with the help of XMLTable shown here running on 11 g Rel 2 (11.2.0.1) - basis for SUNOS:

    select xcust.eid, xmi.ami, xmi.memberNum, xmi.accountNum
    from CROUTREACH.acme_cust cust,
       XMLTable( XMLNAMESPACES(default 'http://www.cigna.com/acme/domains/customer/customerprofile/2011/11'),
           '$doc/customerProfile'
            passing cust.object_value as "doc"
            columns 
               eid varchar2(50) path '@eid'
       ) xcust,
       XMLTable(XMLNAMESPACES(default 'http://www.cigna.com/acme/domains/customer/customerprofile/2011/11'),
           'for $i in /customerProfile/memberInfos/memberInfo return $i'
            passing cust.object_value
            columns
               ami varchar2(15) path 'ami',
               memberNum varchar(20) path 'clientRelationship/memberNum',
               accountNum varchar(20) path 'clientRelationship/accountNum'
      ) xmi
    *where xmi.accountNum = '3174016'*
    *and xmi.memberNum = '07646258301'*
    The development team noted:

    "It worked for a while (minutes)." I'm not familiar with indexing on XML tables, but if we can somehow index by Member num/acct num (even temporarily), I think that it would speed up the process considerably. »

    We have team added Oracle DBA fields num num/acct members to this xmlindex to recreate:
    CREATE INDEX ACME_CUST_XMLINDEX_IX ON ACME_CUST (OBJECT_VALUE) 
          INDEXTYPE IS XDB.XMLINDEX  PARAMETERS ('XMLTABLE ACME_CUST_IDX_TAB 
             XMLNamespaces (''http://www.cigna.com/acme/domains/commoncontact/2011/11'' as "cm",
                 default ''http://www.cigna.com/acme/domains/customer/customerprofile/2011/11''),
             ''/customerProfile'' 
            columns
               DOB date  PATH ''personInformation/cm:birthDate'',
               FIRSTNAME varchar2(40)    PATH ''name/cm:givenName'',
               LASTNAME varchar2(40)  PATH ''name/cm:surName'', 
               SSN varchar2(30) PATH ''identifiers/ssn'',
               MEMBERINFOS XMLType path ''memberInfos/memberInfo'' VIRTUAL 
    
           XMLTable acme_cust_lev2_idx_tab 
           XMLNAMESPACES(default ''http://www.cigna.com/acme/domains/customer/customerprofile/2011/11''),
           ''/memberInfo'' passing MEMBERINFOS 
           columns 
              ami varchar2(40) PATH ''ami'',
              subscId varchar2(50) PATH ''clientRelationship/subscriberInformation/subscriberId'', 
              employeeId varchar2(50) PATH ''systemKeys/employeeId'', 
              clientId varchar2(50) PATH ''clientRelationship/clientId'',
              *accountNum varchar2(50) PATH ''clientRelationship/accountNum''*,
              *memberNum varchar2(50) PATH ''clientRelationship/memberNum'''*) PARALLEL 16;
    Unfortunately, when we run the query XML is slow; a full table scan occurs on the query and the xmlindex do not get used.
    We are at a lost as to why the xmlindex serves not - before and after collecting pass them on the underlying table for the ACME_CUST?
    Especially with highly selective predicates in the WHERE clause.


    Here is the definition of table ACME_CUST:
    CREATE TABLE "CROUTREACH"."ACME_CUST" OF XMLTYPE
      (
        CONSTRAINT "ACME_CUST_ID_PK" PRIMARY KEY ("ACME_CUST_ID") 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 "ACME_DATA" ENABLE
      )
      XMLTYPE STORE AS SECUREFILE BINARY XML
      (
        TABLESPACE "ACME_DATA" ENABLE STORAGE IN ROW CHUNK 8192 CACHE READS LOGGING
        NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1
        MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
        CELL_FLASH_CACHE DEFAULT)
      )
      ALLOW NONSCHEMA ALLOW ANYSCHEMA VIRTUAL COLUMNS
      (
        "EID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/customer/customerprofile/2011/11"; (::)                               
    /customerProfile/@eid'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(15))),
        "ACME_CUST_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/customer/customerprofile/2011/11"; (::)                               
    /customerProfile/@id'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        "CRET_DT" AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
        SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/customer/customerprofile/2011/11"; (::)                                                                                                       
    /customerProfile/@create_dt'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
    WITH
      TIME ZONE)))
      )
      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 "ACME_DATA" ;
    Any help on this is much appreciated to say the least!

    Kind regards
    Rick Blanchard

    Could you post an explain plan?

  • I've updated to Sierra, na not use iCloud, now I see all of my dates in the calendar are gone!

    I've updated to Sierra, na not use iCloud, now I see all of my dates in the calendar are gone!

    If it was in iCloud, turn, if they were not, tell us where they have been

  • By dictating the long notes, using Siri, Siri will stop as soon as I take a little break. Therefore, the note ends abruptly. Any solution for this?

    By dictating the long notes on Mac using Siri, Siri will stop as soon as I take a little break. Therefore, the note ends abruptly. Any solution for this?

    For long notes, you are better to use regular old dictation - under Mac OS for a few years now, Siri is not mandatory.

    To activate it, go to "System Preferences"-> keyboard-> dictation. Once enabled, you can press the "Fn" key twice to activate and dictate the long notes in any application.

    Siri is optimized for short, quick things. I don't think that you can change, you just use the method that is better to listen to what you want to do at the time (short notes, using Siri. Long notes, use dictation).

  • Notification "Trackpad low battery", but I do not use trackpad

    I'm on an iMac OS X El Capitan. I get a notification popup in the upper right corner, the trackpad's batteries are low, but I'm not using a trackpad. My mouse is not even bluetooth. I have a standard mouse that plugs a USB port. So my priority issue is: How do the notification go away? But also: why it does this?

    Click the Bluetooth icon in the menu bar of your Mac, and then select Open Bluetooth preferences...

    What, if any, devices appear in its list of devices ?

  • phone calls do not use the apple device

    I get phone calls, saying: do not use your apple device, are these legitimate calls... I'm afraid that I'm a target? I recall once and they wanted me to hang on to my desk top (I have not)... I can't afford to mess up, so I just haven't used :-/

    No, they are not legitimate calls, ignore them.

  • I have phone i6, when I connect the Wi - Fi, it was connected, but in case of auto-lock, when I open the auto lock or if I m not used 2 or 3 minutes more, he will ask the password for Wi - Fi.

    I have phone i6, when I connect the wi - fi, it was connected, but when the automatic locking has occurred or if I'm not used the phone minutes 2 or 3, after that I'll use the phone, once again, it will ask the password for wi - fi.

    What is an i6 iPhone? There are:

    iPhone 6

    iPhone 6 +.

    iPhone 6 s

    iPhone 6s +.

  • After downloading the recovery "Disk Drill" software it installed an SSD SM768E monitoring program.  I have not used the software "Disk Drill"

    A SM768E of SSD monitoring program is running on my computer.  It appeared after I downloaded, but did not use the file "Disk Drill" and deleted recovery software.  I can't get rid of the monitoring software SSD.  Spin El Capitan 10.11.5 on a 16 GB MacBook Pro retina with processor Intel Core 17 2.7 GHz.  By clicking on the icon tells me to go to "Disk Drill" but its been deleted.  Can I temporarily stop the control, but it starts every time I put on.

    http://help.cleverfiles.com/how-to-uninstall-disk-drill/

    You may need to install the SD to remove it completely

  • My Norton anti-virus software used to work and now it does not work with the new Firefox update. This corrected soon? Otherwise, I will not use the product

    Since your last update that my Norton toolbar will not work... If it does not work, will not use your product. Can it be fixed quickly?

    According to the article, I linked to before, you will need to update the norton version 2015.2.1.13 toolbar that is compatible.

  • I do not use sync and am not connected? Why my favorites are synchronization?

    My desktop computer has a series of bookmarks that I use at work. My home PC has another, different set of bookmarks that I use at home. I do not use sync and am not connected to sync on each PC. Why my favorites are the synchronization between two PCs? For example, I noticed several bookmarks near the top of my bookmark menu over a line of separation that I do not have to work. I deleted them. I come home and find those missing same bookmarks from my PC at home. I do not want to synchronize anything between the two computers, why what is happening?

    Maybe an add-on is the sync these for you.

    Refresh (called "Reset" in older versions of Firefox) can solve a lot of problems in restaurant Firefox as his default factory while saving your bookmarks, history, passwords, cookies, and other essential information.

    Note: When you use this feature, you will lose all the extensions, toolbar customizations, and certain preferences. See article Firefox Refresh - reset modules and parameters for more information.

    Refresh for Firefox:

    1. Open the troubleshooting information page using one of the following methods:

      • Click the menu button

        click Help

        and select troubleshooting information. Should open a new tab containing your troubleshooting information.

      • If you are unable to access the Help menu, type Subject: support in your address bar to bring up the troubleshooting information page.
    2. At the top right of the page, you should see a button that says 'Refresh Firefox' ('reset Firefox' in older versions of Firefox). Click on it.
    3. Firefox closes. Once the update process is complete, Firefox will display a window with the imported information.
    4. Click Finish and reopen Firefox.

    This corrects the problem? Please report to us!

    Thank you.

  • I just got an iphone and am confused with itunes.  I the have not used in years.  I can I sync my music from itunes to iphone.

    I just got an iphone and am confused with itunes.  I the have not used in years.  I can I sync my music from itunes to iPhone.

    You need a computer that is running the latest iTunes version to either a Mac or Windows operating system.

    Mac

    1. Open iTunes.
    2. In the MenuBar at the top of your computer screen, choose iTunes > check for the updates.
    3. Follow the prompts to install the latest version.

    Windows

    1. Open iTunes.
    2. In the MenuBar at the top of the iTunes window, choose Help > check for updates. Learn what to do If you see not the menu bar.
    3. Follow the prompts to install the latest version.

    Instructions for syncing your iPhone here > synchronize your iPhone, iPad or iPod touch with iTunes on your computer via a USB - Apple Support

  • I can not use the command share in safari, mail, notes, etc. since I updated to El Capitan (10.11.5). No way to solve it. Please help me.

    I can not use the command share in safari, mail, notes, etc. since I updated to El Capitan (10.11.5). No way to solve it. Please help me.

    There is a problem with your installation of OS X. The easiest way, but not the fastest way to fix it is to reinstall the operating system. Unless you are in a hurry or have measured access to the network, it is what I suggest, especially since I don't know if there are any problems with the installation. Please backup all data before reinstalling. You won't need the backup unless something is wrong.

    The below, advanced shortcut if it works, can save you some downtime (and the cost of a download of several gigabyte, if necessary.)

    1 back up all data.

    2. disconnect all external storage devices.

    3. start in recovery mode. Select a language, if you are prompted. The OS X Utilities appears. One of the options is to install OS X. This is not what you do.

    4. This step is only necessary if you use FileVault 2. If you don't know what's FileVault, you use it. Go to the next step. Otherwise, launch utility disk, then select the icon for the volume FileVault ("Macintosh HD", unless you have given it a different name.) It will be nested under another icon of the disc. Select open in the file menu and enter your login password when you are prompted. Then quit disk utility must be returned to the main screen.

    5. Select get online help. Safari will launch. While in recovery, you will have no access to your Favorites, but you won't need them. Load this web page.

    6. triple - click anywhere in the line below to select this option:

    chflags -R norestricted /V*/*/S*/*/Caches

    Copy the selected text in the Clipboard by pressing Control-C key combination.

    7. Quit Safari. You go back to the OS X Utilities screen.

    In the menu bar, select

    Utilities ▹ Terminal

    Launch the Terminal application. Paste in the Terminal window by pressing the command-V key combination.

    Wait for a new line ending with a number sign (#) to appear. Quit the Terminal must be returned to the main screen.

    8. Select

    ▹ Restart 

    in the menu bar.

    9. This step must be performed after the restart, and while you are logged as administrator, not in recovery mode. If you have only one user account, you are the administrator.

    Select and copy this line as in step 6:

    sudo /usr/libexec/xpchelper --rebuild-cache

    Paste in a Terminal as before. You will be asked for your login password. Nothing displayed when you type. Type carefully, and then press return. If you do not have a password, you will need to configure one before you can run the command. You can get a warning to be careful. Confirm. You don't need to display the warning.

    If you see a message that your user name "is not in the sudoers file", then you have not logged as an administrator. Log in as one and repeat this step. You don't have to repeat the previous steps.

    Wait for a new line ending with a dollar sign ($) below what you entered.

    10. make as in step 9 with this line:

    sudo /usr/libexec/*/app_sandbox_cache_builder --rebuild-cache

    You can then quit Terminal.

Maybe you are looking for

  • Technique no woman Dozy has prob with the sound driver

    My apologies to all that you technical guys - probably an easy one (I hope)I have a notebook Satellite - no idea what model (useless?)He said HIS 40-702 on the bottom! I can't find any listed information that relates to this model. I "lost" driver fo

  • HP 15 laptop: dark screen appeared after that I connect

    DEAR HP, I CAN'T OPEN MY FIRST ACCOUNT HERE. HERE'S THE SCÉNARION. SHOWS THE START OF HP AND THE LOCK SCREEN. THEN IN OPERATION FOREST-IN MY FIRST ACCOUNT, I ENTER THE PASSWORD, AND THEN AFTER THAT, IT'S ALL DARK. NO FURTHER RESPONSE. SCREEN ALL BLAC

  • Transfer photos from camera to computer

    original title: photo How to transfer pictures taken with my cam for a profile? /

  • How to enlarge my icons on my desktop

    How to enlarge my icons on my desktop?  Thank you, Joyce Young

  • CD burning problems

    I have a Dell Inspiron 1525 with Windows Vista Home Premium.  Lately I had problems with CD burning.  If the CD or DVD already has data on it, it burns very well.  But, if I put a blank CD or DVD in the drive, my computer does not even recognize that