XmlIndex subsetting question


I have a table EMP that contains an xmltype column called empinfo

CREATE TABLE EMP
(
DATE EVENT_DATE,
empinfo SYS. XMLTYPE
)
XMLTYPE XML STORE AS BINARY XML NAVIGATION

This pass of xmltype contains xml unstructured documents. I am interested in indexing on 'empno '.
I am able to create an index, but it will be only works on the first level.


CREATE INDEX subset_xmlindex ON emp (empinfo)
indexType IS xdb.xmlindex
parameters ("PATHS (INCLUDE (//empno))
path table subset_pathtable (undesirable tablespace)');

When I do the next xmlexists, he found all the empno, but it does not use the index.

XMLExists ('/ / * [empno = 171943270] ' from empinfo)

When I do that it finds the empno in the fitrst level and use the index. but it does not find the empno < empinfo > level.
and xmlexists ('/ person / * [empno = 1073630546]' from empinfo)


question: How can I use the index on all the elements 'empno' wherever they are in the doc.
is it still possible? the table contains millions of records.

doc suggest using //empno in the index include the will of the index on the regradless of all the empno hence they are.

-xml1

< person >
< personrecord >
< name >
.....
< empno >
...
< / personrecord >
< / person >


-xml2
< person >
< personinfo >
< name >
....
< empinfo >
< empno >
....
< / empinfo >
....
< / personrecord >
< / person >

Version database please?

And question: is there still a single node "empno" by the document?

The following works for me.

Make sure you pass the link as string variable, no number (unless you create an additional digital index on the VALUE of path):

SQL> select *
  2  from emp
  3  where xmlexists('//empno[.=$empno]'
  4          passing empinfo
  5                , '7777' as "empno"
  6        )
  7  ;

Execution Plan
----------------------------------------------------------
Plan hash value: 1962240707

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation                        | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                 |                                |     1 |   145 |     5  (20)| 00:00:01 |
|   1 |  NESTED LOOPS                    |                                |     1 |   145 |     5  (20)| 00:00:01 |
|   2 |   VIEW                           | VW_SQ_1                        |     1 |    12 |     3   (0)| 00:00:01 |
|   3 |    HASH UNIQUE                   |                                |     1 |    47 |            |          |
|   4 |     NESTED LOOPS                 |                                |       |       |            |          |
|   5 |      NESTED LOOPS                |                                |     1 |    47 |     3   (0)| 00:00:01 |
|   6 |       TABLE ACCESS BY INDEX ROWID| X$PT72R2I5S5V9A9VE0GOACG0GKWIG |     1 |    12 |     2   (0)| 00:00:01 |
|*  7 |        INDEX RANGE SCAN          | X$PR72R2I5S5V9A9VE0GOACG0GKWIG |     1 |       |     1   (0)| 00:00:01 |
|*  8 |       INDEX RANGE SCAN           | SYS166546_SUBSET_XM_VALUE_IX   |     7 |       |     0   (0)| 00:00:01 |
|*  9 |      TABLE ACCESS BY INDEX ROWID | SYS166546_SUBSET_XM_PATH_TABLE |     1 |    35 |     1   (0)| 00:00:01 |
|  10 |   TABLE ACCESS BY USER ROWID     | EMP                            |     1 |   133 |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   7 - access(SYS_PATH_REVERSE("PATH")>=HEXTORAW('021FD8')  AND
              SYS_PATH_REVERSE("PATH")

Alternatively, if each doc contains at most one occurrence of 'empno', you can add a virtual column that retrieves and create an index on this column:

SQL> alter table emp add empno number generated always as (
  2    xmlcast(xmlquery('//empno' passing empinfo returning content) as number)
  3  )
  4  virtual ;

Table altered.

SQL>
SQL> create index emp_empno_i on emp (empno);

Index created.

SQL> select * from emp where empno = 7777;

Execution Plan
----------------------------------------------------------
Plan hash value: 1114809652

-------------------------------------------------------------------------------------------
| Id  | Operation                   | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |             |     1 |   133 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| EMP         |     1 |   133 |     2   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN          | EMP_EMPNO_I |     1 |       |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("EMPNO"=7777)

Tags: Database

Similar Questions

  • See the sum of subset question quiz on a blade of results

    I want to show the sum of part only of scores question quiz on a blade of results.

    I want to still follow and record the scores of questions (acting as a series of tests), but show that the score some of these question marks (final quiz) to the user. I read these steps http://blog.lilybiri.com/intermediate-score-slides but I only need a subset. I'm not getting any summing the scores showing the partition on the slide.

    Any suggestions welcome... Michelle

    Even if you need only a subset, the workflow is quite similar. I would create a variable used to store the total score for the questions in this subset. After each question to consider, you add the value of the variable cpQuizInfoLastSlidePointsscored of system to the user variable. At the end of these questions (don't forget the last of them), you will have the total score for this subset in this user variable.

  • Simple question on the subset of the array

    Well guys, I have a table with a number of 1000, and I want to divide it into 10 tables with 100 numbers

    My question is:

    In the subset of the table, I can put the index and length, in the first subset of table, I put index 0 and length 100, I think it will start at index 1, since 0 does not exist, right?

    then in the next I set 100 index and he will leave the index 101, or I have to put the index 101 to start in 101?

    because the length will always be 100.

    Example:

    1000/10 = 100

    So I have to create 10 tables with 100 numbers each

    Sincerely,

    Eduardo

    LabVIEW arrays are 0 based, so the first element has index 0. 101 item has index 100. So yes, you must specify the 100 index and length 100 for obtaining 101.200.

  • How can I get a list of paths of subset xmlIndex?

    Hello

    How can I get a list of paths of subset xmlIndex?

    I was wondering if there is a query that is able to give me the list of subset a xmlindex unstructured update paths. I want that the groups included and excluded paths.

    Create index.

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

    CREATE HR INDEXES. Ixml_TB_XML1 on HR.tb_xml (XML) INDEXTYPE IS XDB. XMLINDEX PARAMETERS ("PATHS (INCLUDE (//article

    Article/physical_entity/communicator/person/compiler/causal_agent/language

    Article/physical_entity/communicator/person/compiler/causal_agent/language/writer/header/title

    Article / / language

    Article/wee/physical_entity/person/physicist/entity/colleague/adult/scientist/professional/educator/partner/academician/causal_agent/header/categories

    Article/bdy/s/p/dash

    Article/bdy/s/p/list/entry

    Article/physical_entity/person/causal_agent/adult/professional/lawyer/header/bdy

    Article/bdy/dry/ss1/p

    ))')

    /

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

    If exists such request I would get an example, please.

    Kind regards

    Daiane

    Hello

    The info you are looking for are available via {s/n |} ALL THE | USER dictionary views} _XML_INDEXES.

    for example

    SQL > select ex_or_include, x.xpath

    2 of user_xml_indexes I

    3, xmltable ('/ path/paths/settings ' in passing i.parameters)

    path of 4 columns xpath varchar2 (4000) '.'

    5       ) x

    6 where index-name = "IXML_TB_XML1".

    7;

    XPATH EX_OR_INCLUDE

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

    INCLUDE some //article

    INCLUDE the //article/physical_entity/communicator/person/compiler/causal_agent/language

    INCLUDE the //article/physical_entity/communicator/person/compiler/causal_agent/language/wri

    INCLUDE the //article//language

    INCLUDE the //article/pee/physical_entity/person/physicist/entity/colleague/adult/scientist/

    INCLUDE the //article/bdy/sec/p/indent

    INCLUDE the //article/bdy/sec/p/list/entry

    INCLUDE the //article/physical_entity/person/causal_agent/adult/professional/lawyer/header/b

    INCLUDE the //article/bdy/sec/ss1/p

    9 selected lines

  • Question for David Powers on a subset of records display

    David,

    I used your fantastic book, PHP Solutions to great success in the development of my own projects.

    My problem is in the rest of your approach to display a subset of the records in my database. In your book (page 333, php solution 12-4), you use the tables, and in my design, I am using CSS. Everything works fine if I display the record set, but when I want to limit the number of records displayed on a page, I can't make it work. I suspect that your method using the table is "autonomous" insofar as the table was created on the various parameters of the subset.

    I don't have an example of a line of code, rather I would like to find a resource that could help me shed some light on this problem. I have tried things for hours today, but can't achieve my goal to limit the quantity x of subsets per page.

    Any help in the right direction would be greatly appreciated.

    Sincerely,

    wordman

    The fact that the thumbnails are displayed in a table is not relevant. What controls the subset of records being retrieved from the base is the code in step 4 top of page 335.

    $startRow is the current page number (counted from 0) times SHOWMAX (the number of items to display on the page.

    Which translates the SQL on page 2 that said: ' SELECT * LIMIT 6, 6 IMAGES. ($startRow is 1 * 6).

  • How to create a subset of the names in the address book without having to type each name separately?

    When I used to use OE as my email client, it was possible to create "groups" in the address list, with the facility to send then to the group by name, so that each recipient included in the Group of email addresses all received the e-mail in question. (For example, the group named "IVG" consisted of six e-mail addresses, owned by six members of a discussion group, as I do, and I could send all at once simply email for IVG). Now, here's my question: in OE, I could fill the e-mail addresses of members of the Sub-group by simply selecting them in my list (s) global e-mail address. In TB, on the other hand, it seems that the only way to create a "new list" in the global list existing, is to type the address of each recipient by hand - an amazingly arduous task if the subgroup is of any size. And it is not clear that, even when the "new list" is over, it can be used as a "mass mailing" vehicle like the subgroup could in OE. Can someone tell me, please, if and how I can compile a subgroup within the address list of TB in the same way that I have described for OE? (And I can deal with just like a 'name' to send e-mails to all members of the subgroup, as described above?)
    Ian Stewart
    [email protected]

    Start typing and it will automatically complete. If you do not have to type a lot.

    Or create your mailing list, close it, and then drag and drop contacts on its icon.

    As you describe with OE, use the name of the mailing list replaces the addresses it represents. You can of course just select from your address book as any regular Contact entry.

    A significant limitation of the mailing list of Thunderbird, it is that it must be created in an address book with the Contacts he made reference. In other words, if you generate a list in the PAB, it must contain only the Contacts appearing in the personal address book. If you create an entry in a mailing list that is not in his address book parent, a new minimum Contact entry will be automatically created in this address book parent. Put in official terminology, a mailing list is a subset of the address book of its parent.

  • MBP 17 inch 2.5 GHz end 2011 video-questions

    Good day to you all.

    Confusion serious, for me anyway.

    There are and have had problems with the AMD Radeon HD 6750 M and HD 6770 M graphics cards. Suddenly distorted video, random reboots, odd shaped and colored stalls artefarcts etc., in the start of the end.

    I happen to have one of those affected Mbps, a late 2011 model, 17-inch core i7, 2.5 GHz, the model identifier MacBookPro8, 3, model number A1297, EMC 2564. It's still fully usable, nothing wrong, but who could, not necessarily expected or, will come to an abrupt end as many owners, some of my friends have known and display these columns.

    The site of Apple "MacBook Pro repair Extension program for video Issues" (https://www.apple.com/support/macbookpro-videoissues/), I learned:

    products concerned:

    • models of MacBook Pro 15 inch and 17 inch made in 2011.

    • MacBook Pro 15 inch with retina models made from mid-2012-beginning 2013

    I walked to my S/N MBP, it turns out that my MBP is no longer covered.

    MacTracker 7.5.5 I learn that the MBP A1297 introduced in October 2011 and abandoned by June 2012.

    Repair of Apple (for models non-retine) program talks about the models made in 2011.

    My question: how about the models made between January and June, 2012?

    Something has been changed or modified in order to get rid of the problems of graphics cards? Something like, say, update motherboard, graphics, a radiator, redesigned, more powerful fans?

    For me, it's quite confusing, via this link www.chipmunk.nl/klantenservice/applemodel.html, I discovered that my MBP 17 inch out of the Assembly line the 5th week of 2012, factory C0, Quanta Computer China. I'm not the first buyer, I don't know who it was, or when it was first purchased.

    What I worry, in other words is my MBP 'off-the-hook '?

    Could someone shine some light in this?

    With sincere greetings from continental Europe

    Khalid Hoogenbos

    The original questions developed in some 2010 models with integrated graphics discrete AND who uses graphics switching. These have proved to finally have a DEFAULT MONSTER - a defect in the graphics chip itself. The problem was there from the moment when they were built, but itself has failed, until these Macs have been highlighted or installed the latest versions of Mac OS X.

    In order to determine what was causing the growing pile of bad mothers replaced the field, Apple has developed the video switching Test (VST).

    Trying to continue studying these issues, other issues appeared in some 2011 models. These were not the same hidden defects in the chips, but Apple has never revealed exactly what they were.

    Some users suggested that they might have been problems with the excessive heat generated or process, such as the exact used solder type, or the amount the technique with which it has been applied, or all of this and more. You must be certain that all relevant updates have been applied, (if any) that these may affect cooling fan control.

    When you see a reminder that is limited to a certain period of time, you can generally be assured that if your Mac does not fall within the time limits stipulated it is simply NOT submitted the issues addressed in the callback.

    To be eligible for the reminder, your Mac must strictly comply with ALL requirements. It is a very small subset of users whose MacBook Pro of the time period appropriate have additional problems and will not start. They are NOT eligible for the free motherboard replacement, because they can not run (and therefore may not) the VST test.

  • Order General questioning of IEC 60870-5-104

    Dear all,

    I use the NI Communications toolkit to create slave IEC 60870-5-104 (station controlled).

    I use s/w of Triangel microworks part and use it as the master for the same. I am able to send and receive the bulk of orders with the examples provided with the Toolkit to "C:\Program NIUninstaller Instruments\LabVIEW 2012\examples\IEC60870-5,

    I am not able to find a way to capture the "questioning general command" from the server.

     

    Can someone help me how to proceed with this.

    Thank you.

    Hi Frabto,

    The development team has had some great insights below. I have bad informed you (sorry!) behavior, that the command general question should be processed automatically in the communication stack.

    First the order of query sent to control the station may request the complete(station interrogation) or a subset (group interview) of all the data points on the control station. NEITHER 60870-5 to the command station supports the command when the control station receives an order of questioning of the station, it will reply with all the values of the data points. If the Group interrogation command, it will reply with the values of the data points that belong to the group. Users are not able to detect whether the query command is received or not, is automatically handled inside the battery, it allows users of the VI called "Set Group.vi" inside the VI polymorphic "set Property.vi" to set a point to be one of the 16 groups and you can see the usage with the example 'Interrogate information in Group.vi objects' in the folder of the example 60870-5.

    You shouldn't need to do anything to respond to a command of the interrogation. The station will automatically answer. I hope that I did not cause you too much confusion on this point.

  • Positions the cursor can not extract the subset of waveform

    Hello

    I try to get two positions the cursor on a graph of waveform for the entries for the code below, which will start a process that will analyze a subset of the wave. The two sliders define the start and endpoint for the waveform (cursor 0 is the starting point, slider 1 is the endpoint). However, I have questions as Labview continues to tell me that the values I have chosen are not the integer multiples of dt. I don't know what it takes to avoid this problem. I tried to get cursor plots are of unique land types so they snap to the values x (I guess it's that simple concession means), but it makes no difference. Note that there are 2 slots originally going to this graph of waveform (waveform original and medium), but the selection should be only one of them (single parcel is attributed to original waveform). Help, please!

    Edit - just a quick update. I noticed that if I re - run the VI and activate this part of the VI that supports the subset of waveform, I actually get what I want. So, I guess that I don't put something correctly in another part of the VI where I have a structure of the event that updates the position of the cursor in numerical indicators. Could be the problem?

    I solved the problem. Have the two sliders on the plateau at the only plot on the original waveform should have prevented this problem, but I didn't notice that I was feeding in an another waveform beforehand which automatically changes the assignment of the cursor, causing my problem.

    Now cursors remain set on the only ground I want after a few adjustments.

  • In questions of Structure Place

    1st question

    I want to get three items in a table, but I didn't need to edit the table.  Should I just use array index function?

    Since I am not modify items in this table, I shouldn't use in the structure of the place? I'm OK with the thought that I should use only in the structure of the square when working directly on the elements in an array?

    2nd question

    Make method 1, method 2 or method 3 make a huge different?  This code will be called all the ~ 50 ms.

    1 just use Index Array or subset of the table.

    2. There is no difference once the compiler makes its optimizations.  Just use method 1.

    In general, the Structure element adds very little benefit in modern versions of LabVIEW.  There are rare exceptions, but the compiler handles a large percentage of the shares "in place" you will perform.

  • Mobile HP 8570w workstation: HP 8570w, Windows 10 Ent, sleep mode question

    Hello

    I have just upgraded to Windows Enterprise 10 with clean install.  I used to use Softpaq Download manager patch my drivers on previous versions of Windows, but now I see only the subset of drivers for Windows 10. I tried to research forum if someone had questions as I have but has not been able to find.

    This is when I press Fn + F3, 8570w actually turns off without going into standby mode, so I can quickly return to work when I need.

    BIOS is on the latest version of this model, Windows is patched as well. No idea where to look?

    Thank you

    D

    and this has solved the problem with sleep:

    http://h20564.www2.HP.com/hpsc/SWD/public/detail?swItemId=ob_151366_1&swEnvOid=4192

    HP does a bad job, keep the driver for some models to update pages...

  • How to return the subset of an array of basic condition bits

    Hello

    I have a question on how to get the subset of the table based on scraps of condition...

    For example, if I had a 4 x 4 array of 2D of DAQ system data.

    Table 1:

    1 2 3 4

    1 2 3 4

    1 2 3 4

    1 2 3 4

    and a 1 d table showing the conditions of each channel...

    Table 2:

    1

    0

    1

    0

    The function I want to do is to collect data only from the channel status bits are 1. In the above example, I want to only retrieve data from channels 0 and 2. Any idea? Thank you!

    Hi oly.

    Check this VI...

    Thank you and best regards,

    srikrishnaNF

  • What class of object for a subset of table vi?

    I use VI of script to create a subset of the table function.  The problem is that I don't know what class of object VI plug on the new node of object of VI.  I tried the function and Index table, but these two cause errors of execution, who say that the selected style (subset of the table) is not compatible with the class.

    And just like a more general question, how do you determine the class to use in general?  I know that the point is that the selected class determines the type of refnum that came out, but I think that whenever I encounter this problem it is a matter of trial and error to determine what will work class VI.

    As you know, a table subset function is not a peer of the front panel, so I can't right click on it to create a reference to know what type it is...

    Thanks for the help

    Use GrowableFunction for the purpose of vi class and the subset of the table for the style. GrowableFunction covers a multitude of nodes...

  • build a subset of spare board

    Hello

    I want to build a subset of the table replace but I can't.

    I have tried different methods to create without success. My question is where to put in my program, what to insert as an n-dimensional array and how to connect the index and my new elements in the true and the false case.

    The size of the table i want to be 1 x 24, the index comes from a counter, new items are the result of a loop in a housing structure. They're all locked up in a while loop. The structure of the deal for the loop and the counter became real every 2 minutes.

    Here is a picture of my program.

    Concerning

    This is a common problem. Whenever you loop you start with the same table, so the behavior you describe. Fix it, change the connection of tables Initialized in the loop of a shift register and feed table replaced on the side of the exit of the SR. The SR powering the newly modified table the following loop, I bet that's what you want.

    /Y

  • The queue from table question

    I had a recent application where I wanted to take 100 samples of something then get the RMS of the dara. This is happening in a loop, and until the end of the program. Very basic stuff.

    • Method of the QUEUE:
    • Get queues with max 100 items.
    • Queue data (data arrive on every 50mS).
    • Get the status of the queue when the number of items is 100...
    • ... Empty the queue and get all the items (which of course will be a prison guard) and use the RMS funtion.
    • Repeat

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

    • TABLE method:
    • Initialize the array with 100 elements of the DBL 9999.99 (it is a value that can only happen in the data)
    • Insert data in the table to help replace a subset of table
    • When 100 index isn't 9999.99, then...
    • ... Put the table in the RMS function, then re - initialize the full array of the 9999.99
    • Repeat

    My questions are, who should be faster, including better management of memory?

    Thank you!

    Why not just use the RMS PtByPt VI. In this way, you don't need to store data at all? This may require that marginally more calculation, but will require less memory.

    If you insist on the pad, I'd probably go with the table for simplicity. I think you can simplify your system to determine when to treat well. No reason to have all these 9999.99 is here.

    Chris

Maybe you are looking for