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'''
);

Tags: Database

Similar Questions

  • Why can I not use 'Open the message in a conversation' more?

    We are 4 users and both of them have version 24.3.0, and two are on 24.4.0.
    We use the option "open message in the conversation" a lot and all of a sudden this option is no longer available. Is there a setting that could have been changed to make it happen?
    The only thing that has changed is that I have rearranged our records using "manually sort folders" - this could it be?

    All messages with a thread of before yesterday are always available with "open message in the conversation", but anything in the afternoon yesterday do not display the option when you right-click and using the swift short ctrl O does nothing.

    Any suggestions, what could be wrong are very welcomed.

    Thanks guys,.

    I think I managed to do the sorting now. I've done the following:
    See help at the top and choose "restart with disabled modules.
    Are you sure...? Press "restart".
    It will now ask you if you want to start in safe mode. Choose this option.
    The "manually sort folders work" is now disabled.
    Now close Thunderbird and wait a bit.
    Now open again, check if you have the Add-ons back - manually sort folders.
    Try to click an email again to view the message in a conversation.
    And so it works with adding on and open it in the conversation. Very strange but if it works, I'm happy.

  • Why index is not used by the subquery?

    Hello

    ENV: 11 GR 2 on Linux Oracle 5.8 64 bit on file system,

    I have the following query:

    Select * to processing_instruction pi where pi.last_updated = (select / * + index (idx_pi_client_merchant_status FT2) * / max (pi2.last_updated))

    to processing_instruction FT2

    where pi2.client_no = pi.client_no

    and pi2.merchant_id = pi.merchant_id

    and pi2.status = 'C')

    I created an index:

    CREATE INDEXES TO PROCESSING_INSTRUCTION IDX_PI_CLIENT_MERCHANT_STATUS

    (CLIENT_NO, MERCHANT_ID, STATUS)

    Oracle still does a full-table scan on the ' processing_instruction FT2 ' table (subquery) even though I also put the indicator INDEX.» The table has rows '55621245 '. There are several lines for a given client_no, the merchant_id and status 'C '. I want to only choose one that has been updated the last (newest one).

    I'm sure there may be a better way to do this, but...

    Please notify.

    Concerning

    the order of the keys, and the columns questions

    Try (status, last_updated)

  • What are the parameters? How are Variables differenet? Why we can not use variables to pass data to one sequnece to another? What is the advantage to use parameters instead of Variables?

    Hi all

    I am new to TestStand. Still in the learning process.

    What are the parameters? How are Variables differenet? Why we can not use variables to pass data to one sequnece to another? What is the advantage to use parameters instead of Variables?

    Thanks in advance,

    LaVIEWan

    I'm sorry... I discovered that... its not at all possible to pass data to another sequence using variables... it must be through settings... once again I apologize for the display of such a stupid question

  • I recently used a dvd + rw disk to back up my photos. Now when I put a dvd in my pc, why it will not display on the screen that's all there is, or how to give me access to it?

    I recently used a dvd + rw disk to back up my photos. Now when I put a dvd in my pc, why it will not display on the screen that's all there is, or how to give me access to it?

    Depends on what you used for the backup.

    If you used the windows backup or another backup software will contain the entire disk will be a backup file, and view/use this file, you use the same software that allows you to save.

  • After the cancellation of my subscription, why can I not use my old previous Adobe products?

    After the cancellation of my subscription, why can I not use my old previous Adobe products?

    I thought my old apps (CC and CC2014) would always work

    N °

    When you cancel your subscription, all software related to that subscription will stop working. This includes any software with CC in his name.

    The only way to continue to use the CC versions is to re - register.

    All versions perpetually under license that was purchased before you subscribed for example, CS4, CS5, CS6 will continue to work as usual.

  • I just bought a new Mac and migrated my CS6 on.  Now, when I open it, I said that I am under a trial of the cloud.  Why can I not use my CS6 version that I bought?  I don't want to pay for something I already bought.

    I just bought a new Mac and migrated my CS6 on.  Now, when I open it, I said that I am under a trial of the cloud.  Why can I not use my CS6 version that I bought?  I don't want to pay for something I already bought.

    Here's how to convert the Permanent Trail:

    By receiving the expired Trial/test screen

    Make sure you are online

    Click on software under license

    The perpetual owners: connect with the adobe ID and enter the serial number of the product

    Product must be certified with success

  • Why can I not use hidden or display point only to store the value for insertion?

    Hi, gurus:

    I have a question:

    I implemented a form with the region of report in a page, the update works OK, but the add function has a problem:

    There is a column, offender_ID, which is a foreign key to another table, it must not be null during insertion. However, even I pass the ID of the author of the offence of master page when user click on the button create and he did watch in the form, it must be a text tabled for insert success, why can I not use hidden or display point only to store this value for insert? (If I use hidden or display single element insert will be successful, apex reports I tried to insert a null value for the offender_ID column.)

    Thanks in advance.

    Sam

    Hello

    There is a column, offender_ID, which is a foreign key to another table, it must not be null during insertion. However, even I pass the ID of the author of the offence of master page when user click on the button create and he did watch in the form, it must be a text tabled for insert success, why can I not use hidden or display point only to store this value for insert? (If I use hidden or display single element insert will be successful, apex reports I tried to insert a null value for the offender_ID column.)

    I think that both hidden and display elements have attributes that can cause problems because of different ways these function elements as the only non-display and feature no hidden items. The only items have a "Save Session State' yes/no 'control'? This can be a problem.

    Would you do that? Do these regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.

    Howard

    Congratulations. I'm glad you found the solution.

    Published by: Howard (in training) April 11, 2013 10:26

  • I use Illustrator CS6 (Mac). I use the free transform tool. Why can I not use shift, Option, command to distort in perspective?

    I use Illustrator CS6 (Mac). I use the free transform tool. Why can I not use shift, Option, command to distort in perspective?

    Ah, hong.

    Then, drag Option and only use Cmd + shift.

  • Why can I not use ready boost with flash player in my home premiun wvista?

    Why can I not use ready boost with flash player in my home premiun wvista?

    Hello

    This Flash drive is probably too slow for configure ReadyBoost.

    Here is some information that should help you:

    ReadyBoost
    http://www.vista4beginners.com/ReadyBoost

    What is ReadyBoost
    http://www.winvistatips.com/ReadyBoost-T25.html
    Explore the features: Windows ReadyBoost
    http://Windows.Microsoft.com/en-us/Windows7/products/features/ReadyBoost

    Understand the ReadyBoost and the question of whether it will Speed Up your system
    http://TechNet.Microsoft.com/en-us/magazine/ff356869.aspx

    DON'T GO OUT AND JUST BUY A READER WHO CLAIMS THAT IT IS READYBOOST
    LOAN - many are lying or stretching at least the truth. Look at the sides of the player below
    and buy one you know is FAST.

    Don't forget that the readyboost max cache is 4 GB Vista and 256 GB Windows 7. If your device
    is more than you can use it for storage. And you need a fast reader.

    ReadyBoost - list of speed Flash memory
    http://www.techcrater.com/2007/04/05/ReadyBoost-Flash-memory-speed-list/

    How to find the index of ReadyBoost speed
    http://www.techcrater.com/2007/04/06/how-to-find-ReadyBoost-speed-rating/

    Speed tests USB Flash Drive - any size car - link to the utility USBDeview
    http://usbspeed.NirSoft.NET/

    Publish a speed test of your USB - also a link to the utility USBDeview flash drive
    http://usbspeed.NirSoft.NET/publish_usb_flash_drive_speed.html

    http://www.grantgibson.co.uk/misc/ReadyBoost/?make=SanDisk

    http://www.techcrater.com/2007/04/05/ReadyBoost-Flash-memory-speed-list/

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • 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'
    
  • Why can I not use my ITunes credit to buy a movie on Apple TV?

    Why can I not use my Itunes credit to rent a movie on Apple TV?

    the credit, which I like to use is the same that if I buy an App?

    Apple TV wants to charge my credit card to rent a movie

    You can use the credit to rent a movie on Apple TV. Your card will be charged if the credit is not sufficient to cover the rental

  • Why can I not use three fingers to drag an item on my screen?

    Why can I not use three fingers to drag an item on my screen?

    There is no option in the preferences system - trackpad.

    How can I go back to os x? I am not happy with El Capitan

    Thank you

    See here three-finger drag is gone in my macbook air?

  • Why can I not use shift to select several thumbnails of Pages?

    Why can I not use the SHIFT key to select several thumbnails of Pages?  I need to transfer several pages in the Pages of a document to another document, and I can't select these multiple pages in the thumbnails by pressing the shift or command key.  Help, please!

    By selecting several thumbnails, and copy and paste any thumbnails in another document of v5.6.1 Pages is not supported. You get to select the contents of a real individual page and then copy and paste between documents.

    In Pages ' 09 v4.3, you can select several thumbnails and then copy / paste these in the Gallery of thumbnails of another document. If the Pages ' 09 has been installed prior to any publication pages v5, older Pages move silently in Applications: iWork ' 09 file. You would have to export your content Pages v5.6.1 as document Pages ' 09 for backward compatibility.

  • Why can I not use my old genuine copy of windows Vista on my new pc?

    Windows vista on new pc

    Why can I not use my old genuine copy of windows vista on my new pc?
    I received an activation message and I don't know what to do

    If your Vista came pre-installed in your old PC, then this is an OEM license that cannot be transferred to your new PC.

    To analyze and solve problems for Activation and Validation, we need to see a full copy of the report produced by the MGADiag (download and save to the desktop - http://go.microsoft.com/fwlink/?linkid=52012 ) tool
    Once saved, run the tool.
    Click on the button continue, which will produce the report.
    To copy the report in your response, click the button copy in the tool (ignore the error at this stage), and then paste (using r-click and paste or Ctrl + V) in your response.
    -* in your own thread *, please

    Please also state the Version and edition of Windows cited on your COA sticker (if you have one) on the case with your machine, but do NOT quote the key on the sticker!
     http://www.Microsoft.com/howtotell/content.aspx?PG=COA

Maybe you are looking for

  • New iPhone is not compatible with Macbook

    I upgraded my iPhone and found that it is not compatible with my MacBook running 10.6.8. I have a lot of music that I have not bought on the iTunes store I can't transfer it to my phone. Is there a software that I can use it, or I have to buy a new c

  • Restoration of the system, makes my invalid product key.

    A recent windows vista update would affect with my internet wireless USB-adapter, so I used the restoration of the system itself if I could go back and do work again. Now the system asking for my product key when I log in (online registration) and fi

  • RIP from a CD, a message appears - CD A player is required to rip music from a CD

    When I go to rip from a CD, a message appears - CD A player is required to rip music from a CD.  I don't know how to tell where the CD side is. Windows media player

  • HorizontalFieldManager question

    I have the following text for the day of the week display boxes public HorizontalFieldManager ffm_days = new HorizontalFieldManager (Field.FIELD_LEFT); ffm_days. Add (Days [i]) This.Add (ffm_days) This works very well on all operating systems, but NO

  • check disk running in elevated position

    provides an access denied the post when I try to use a command prompt to check a disk