The simplest way to get more performance on select on xmltype column?

We have a table with xmltype column:
CREATE TABLE "TK"."PLAN_2" ("UNID" NUMBER NOT
NULL,
"XMLSTRING" "TK"."XMLTYPE",
CONSTRAINT "SYS_C001142583" PRIMARY KEY("UNID")
USING INDEX
TABLESPACE "TX"
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0) PCTFREE 10 INITRANS 2 MAXTRANS 255)
The data in column xmlstring looks like this:
<Agent>
<OP End="2520000" Id="001_8232_0_91" Origin="Autos" Quantity="1.0 ea" Start="2520000">
<OSP Key="ADM_ID" String="001_8232_0" />
<OSP Key="AddAutoNr" String="0" />
<OSP Key="CURRENT_STATE" String="Tages-Vorgabe" />
<OLP Key="ChUser">
<OIP Key="(T_SP) test2" Long="1218125408541" />
<OIP Key="(T_SP) admin" Long="1219071385346" />
<OIP Key="(T_SP) test2" Long="1237540381906" />
</OLP>
<OSP Key="Debicode" String="9903" />
<OSP Key="Resource" String="SBN" />
<OSP Key="TrafficDay" String="91" />
<OSP Key="AutoNrSchema" String="001" />
<OSP Key="AutoNumber" String="8232" />
<OPE End="0" Id="Prod" Origin="Autos|Prod" Start="0">
<OProd Duration="0" End="0" Id="Produce" OriginDirect="Autos|Prod|Produce" Quantity="1.0 ea" Start="0" Type="Produce">
<OSP Key="RESelection.Parameter" String="Resource" />
<Resource Id="Autos" />
<Alloc From="OP|001_8232_0_91|Prod|Produce" Id="" Quantity="1.0 ea" To="CO|001_8232_0_91|001_8232_0_91" Type="PRODUCEREQ_TO_CONSUMEREQ" />
</OProd>
</OPE>
<OPE End="2520000" Id="Step_0" Origin="Autos|Step" Start="0">
<OQP Key="Delay" Overridden="true" Quantity="0.0 s" />
<OQP Key="Distance" Quantity="44.84 km" />
<OQP Key="Duration" Quantity="2520.0 s" />
<OQP Key="Fahrt" Quantity="2520.0 s" />
<OSP Key="From" String="BS" />
<OSP Key="I1" String="0" />
<OSP Key="PLACE" String="1" />
<OQP Key="StartDelay" Overridden="true" Quantity="0.0 s" />
<OQP Key="TWait" Overridden="true" Quantity="0.0 s" />
<OSP Key="To" String="OL" />
<OUse Duration="2520000" End="2520000" Id="LStep_0" Name="L" OriginDirect="Autos|Step|LStep" Quantity="1.0 ea" Start="0" Type="Step">
<OSP Key="I2" String="0" />
<OIP Key="LPOSITION" Long="1" Overridden="true" />
<OSP Key="PLACE" String="1" />
<OQP Key="Wait" Overridden="true" Quantity="0.0 s" />
<Resource Id="vs_RABe525_13" />
</OUse>
<OUse Duration="480000" End="0" Id="LPre_0" Name="L" OriginDirect="Autos|Step|LPre" Quantity="1.0 ea" Start="-480000" Type="Pre">
<OQP Key="Fahrbereit" Overridden="true" Quantity="2 min" />
<OSP Key="From" Overridden="true" String="BS" />
<OSP Key="I2" String="0" />
<OSP Key="PLACE" String="1" />
<OSP Key="StepIndex" String="0" />
<OSP Key="To" Overridden="true" String="BS" />
<OQP Key="Vorbereitung" Overridden="true" Quantity="6 min" />
<Resource Id="vs_RABe525_13" />
</OUse>
<OUse Duration="600000" End="3120000" Id="LPost_0" Name="L" OriginDirect="Autos|Step|LPost" Quantity="1.0 ea" Start="2520000" Type="Post">
<OQP Key="Abstellzeit" Overridden="true" Quantity="4 min" />
<OSP Key="From" Overridden="true" String="OL" />
<OSP Key="I2" String="0" />
<OQP Key="Nachbereitung" Overridden="true" Quantity="6 min" />
<OSP Key="PLACE" String="1" />
<OSP Key="StepIndex" String="0" />
<OSP Key="To" Overridden="true" String="OL" />
<Resource Id="vs_RABe525_13" />
</OUse>
<OUse Duration="2520000" End="2520000" Id="FStep_0" Name="F" OriginDirect="Autos|Step|FStep" Quantity="1.0 ea" Start="0" Type="Step">
<OSP Key="I2" String="0" />
<OSP Key="PLACE" String="1" />
<OQP Key="Wait" Overridden="true" Quantity="0.0 s" />
<Resource Id="ps_P112" />
</OUse>
<OUse Duration="480000" End="0" Id="FPre_0" Name="F" OriginDirect="Autos|Step|FPre" Quantity="1.0 ea" Start="-480000" Type="Pre">
<OQP Key="Fahrbereit" Overridden="true" Quantity="2 min" />
<OSP Key="From" Overridden="true" String="BS" />
<OSP Key="I2" String="0" />
<OSP Key="PLACE" String="1" />
<OSP Key="StepIndex" String="0" />
<OQP Key="Taxi" Overridden="true" Quantity="0 s" />
<OSP Key="To" Overridden="true" String="BS" />
<OQP Key="Vorbereitung" O verridden="true" Quantity="6 min" />
<OQP Key="Wegzeit" Overridden="true" Quantity="0 s" />
<Resource Id="ps_P112" />
</OUse>
<OUse Duration="600000" End="3120000" Id="FPost_0" Name="F" OriginDirect="Autos|Step|FPost" Quantity="1.0 ea" Start="2520000" Type="Post">
<OQP Key="Abstellzeit" Overridden="true" Quantity="4 min" />
<OSP Key="From" Overridden="true" String="OL" />
<OSP Key="I2" String="0" />
<OQP Key="Nachbereitung" Overridden="true" Quantity="6 min" />
<OSP Key="PLACE" String="1" />
<OSP Key="StepIndex" String="0" />
<OQP Key="Taxi" Overridden="true" Quantity="0 s" />
<OSP Key="To" Overridden="true" String="OL" />
<OQP Key="Wegzeit" Overridden="true" Quantity="0 s" />
<Resource Id="ps_P112" />
</OUse>
</OPE>
</OP>
</Agent>
We try to select:
SELECT UNID, extractValue(value(OUSE_XMLSTRING), '/OUse/Resource/@Id') OUSE_RESOURCE,
extract(XMLSTRING, '/Agent/OP/OSP[@Key = "TrafficDay"]/@String') TT_DAY,
extract(XMLSTRING, '/Agent/OP/@Start') OP_START,
extract(XMLSTRING, '/Agent/OP/@End') OP_END,
extract(XMLSTRING, '/Agent/OP/OSP[@Key = "ADM_ID"]/@String') ADM_ID,
extractValue(value(OUSE_XMLSTRING), '/OUse/@Start') OUSE_START,
extractValue(value(OUSE_XMLSTRING), '/OUse/@End') OUSE_END
FROM tk.plan_2, table(XMLSequence(extract(XMLSTRING, '//Agent/OP//OPE//OUse'))) OUSE_XMLSTRING
where extractValue(value(OUSE_XMLSTRING), '/OUse/Resource/@Id') = 'vs_RABe525_13';
with this explain plan:
PLAN_TABLE_OUTPUT
Plan hash value: 3476314316
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 101 | 22018 | 31 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | 101 | 22018 | 31 (0)| 00:00:01 |
| 2 | TABLE ACCESS FULL | PLAN_2 | 2 | 432 | 2 (0)| 00:00:01 |
|* 3 | COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE | | | | |
Predicate Information (identified by operation id):
3 - filter(EXTRACTVALUE(VALUE(KOKBF$),'/OUse/Resource/@Id')='vs_RABe525_13')
We want to select on the 'ID', which occurs more than once in the xmlstring and the table gonna be big, so we think we need some kind of index on the ID-Identifier. What will be the best way to do this?

Which version of Oracle (4 digits)?
If 10.2 or greater, look into using XMLTable and that is the replacement for the table(XMLSequence(extract()) approach. Also, avoid the use of // unless you really need it. I doubt it will make a difference in your situation but just a good performance approach in general.
We want to select on the 'ID', which occurs more than once in the xmlstringI assume you are going to want the count(...) > 1 from the XML to tell you which you are selecting?
I also have questions about what that XMLType is being stored as but that depends upon what your version is regarding what storage options you have.
Edited by: A_Non on Jun 7, 2010 10:55 AM
Forgot to add, look in the FAQ (under your sign-in name on the upper right) for how to use the tag to better format your posts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • The simplest way to get a line chart

    Hi there. Could You tell me what's the simplest way to get such effect as below:
    http://docs.xuiframework.com/xchart/images/lineChart.jpg
    A piece of code would be very helpful. I'm not thinking of GFW_PRES_SHOW FModule, because it has limitations 32 data elements whilst I need more than 32.
    I'd be very thankful for suggestions. Greetings.

    Amitava De
    I need to put chart into screen container
    a®s
    Unfortunately not

  • What is the simplest  way to get a xml-file from 10g R2 -database ?

    Hi,
    I'm new in xml, there are so many tools to work with xml:
    what is the simplest way to get a xml-file from 10g R2 -database ?
    I have : 10g R2 and a xsd.file to describe the xml-structure
    thank you
    Norbert

    There is no automatic way to generate XML documents from an arbitary set of relational tables using the information contained in an XML Schema. Typically the easiest way to generate XML from relational data is to use the SQL/XML operators (XMLElement, XMLAGG, XMLAttribtues, XMLForest). There are many examples of using these operators in the forums You can validate the generated XML against the XML Schema by registering the XML Schema with XML DB and then using the XMLType.SchemaValidate() method

  • What is the simplest way to get video from mini DV tapes into computer

    My computer has no firewire connection. What is the simplest way to get the video from my camera (JVC GR-D340EK) ?

    Mikeathome
    Thanks for the reply.
    The reason that I asked if this was a one time thing or not was related to my thoughts about asking you to look at the relative costs of have the DV data capture firewire done professional or by a friend versus going through looking for slots on your computer for a firewire card or purchasing a computer that still comes with a firewire port.
    We will be watching for further developments.
    Thanks.
    ATR

  • THE SIMPLEST WAY TO GET A DVD MOVIE IN IPOD VIDEO IN 2-3 HRS

    I just got the Ipod video and got Quick time 7pro and everything but it is not the right software to play a DVD or get a dvd movie into ipod. So i tell you exactly what to do: go to carrydvd.com, find the version for use on symbian and psp. download it to test it or buy it to be able to convert a whole dvd movie. When you have the software ready you just put the DVD in, on the screen go where it says select video quality: PSP (MP4) Hi quality. go to screen size select 320X240 (PSP, PALM OR WINCE) PRESS PLAY BUTTON AND IT WILL COMPRESS. WHEN FINISH YOU GO TO ITUNES AND IN FILE GO TO ADD FILE TO LIBRARY, LOCATE THE MOVIE YOU JUST COMPRESSED AND ADD IT TO THE LIBRARY, THEN CONNECT THE IPOD AND JUST PUT THE MOVIE FROM THE LIBRARY TO THE IPOD AND IS READY. I JUST GOT IN MY IPOD TROY WITH THE QUALITY OF A BOUGHT VIDEO OF ITUNES MUSIC STORE.

    Have you checked this:
    sehested, "Tutorial: How to get DVD's on your iPod", 12:50pm Nov 8, 2005 CDT

  • Java -mx... the only way to get more memory in java?

    I have the problem that i must use many and large images and therefore i get the "Out Of Memory" error. In this forum, i found many posts about this, but the only solution i found was to use the the option "-mx".
    I don't know what this option does. Does it increase the memory i can use during running the program? If it is so, then i am really disappointed...
    Actually i would like to use the whole memory which is available on a computer, virtual and RAM. In C++ this is automatically done, is this not possible with Java?

    Summary: yes, you are limited to the JVM size.
    This is a known trade-off between C++ and Java: with Java you get a 'safe' sandbox, rather than unlimited OS memory access. Hence buffer overruns and other exploits are not possible. Java's automatic garbage collection (where's that in C++?) is also optimised for a limited heap size.
    The available JVM memory is strictly limited to a heap size, which as you note is given a fixed size at startup.
    (i) you are free to specify a heap size of 1GB or 2GB (indeed, this is common on corporate servers).
    (ii) you may find the Buffer features of the NIO package useful for accessing very large files partially in memory and partially from disk.
    See http://java.sun.com/j2se/1.4.2/docs/api/java/nio/package-summary.html#buffers
    Good luck
    - Aaron

  • [Solved]Simplest way to get PPPoE working.

    I'm building a computer for my grandfather and he'll be using Bell which provides DSL internet. I don't use Bell at my home so I can't test if it'll connect before I take it over. So what is the simplest way to get PPPoE working?
    Also is it possible to install only OpenOffice Writer and not the other stuff?
    Last edited by jordanwb (2008-12-17 18:00:40)

    a) Install the pppoe pkg and then run pppoe-setup.
    b) Afaik no. Use Abiword instead.

  • Is there a way to get more detailed information through web history logs through the router

    I have several people living in my household and connected to my router. I want to know if there is a way to get more specifics from my history log through my wireless connection. I own a cisco linksys modem and router and would like to know how to access that kind of information or if there is a way of doing so. Is there a software you can use to connect to your router done way or any way to use your router to get more information than what is presented through the logs as they are?

    Hi Crimsonrain,
    What is the model number of your router? 

  • My 3rd generation ipad even though my battery is at 100 % the screen goes black after sitting for more than 15 mins. The only way to get it to come is by resetting the ipad. Is there a fix for this. It all started after the last two updates.

    my 3rd generation ipad even though my battery is at 100 % the screen goes black after sitting for more than 15 mins. The only way to get it to come is by resetting the ipad. Is there a fix for this. It all started after the last two updates.

    Try a Reset...
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    If no joy... Try a Restore...
    1: Connect the device to your computer and open iTunes.
    2: If the device appears in iTunes, select and click Restore on the Summary pane.
    3: If the device doesn't appear in iTunes, try using the steps in this article to force the device into recovery mode.
    From Here
    Unresponsive iPad
    http://support.apple.com/kb/TS3281

  • The simplest way for plsql procedure to return multiple rows

    Hi,
    What is the simplest way for plsql procedure to return multiple rows (records). There are many combination of ways to do it but I am looking for a solution that is appropriate for plsql beginners. Many solutions use cursors, cursor variables, collections and more that kind of things that are complex on the face of it. Is it somehow possible to achieve the same with less effort?
    Sample query would be: SELECT * FROM EMPLOYEES;
    I want to use returned rows in APEX to compose APEX SQL(in that context plsql) report.
    It is enough to use just SELECT * FROM EMPLOYEES query in APEX but I want to use plsql procedure for that.
    Thank you!

    Hi,
    It depends :-).
    With +...that is appropriate for plsql beginners...+ in mind... it still depends!
    The list of techniques (ref cursors, cursor variables, collections, arrays, using explict SQL) you have referenced in your post can be made to work. but...
    +Is it somehow possible to achieve the same with less effort?+ Less effort : That needs to be defined (measured). Especially in the context of pl/sql beginners (who is a beginner?) .
    What is the level of "programming experience" ?
    What is the level of understanding of "Relational Result set" as processible in Oracle?
    If you are looking for
    Process_the_set_of rows_in APEX () kind of capabilitywhich "abstracts/hides" relation database from developers when working on relation database, it may not be the best approach (at least strategically). Because I believe it already is abstracted enough.
    I find REF CUROSOR most effective for such use, when the "begginer" has basic understanding of processing SQL result set .
    So in a nut shell, the techniques (that you already are familiar with) are the tools available. I am not aware of any alternative tools (in pure Oracle) that will simplify / hide basics from develpers.
    vr,
    Sudhakar B.

  • Any way to get more than 1000 characters in notes?

    i was just wondering if there was any way to get more than 1000 characters in the notes section of the ipod. i have outlines for school and they are a lot longer than 1000 characters... i didnt know if there is a setting on itunes or the ipod or a hack or mod to make it more than 1000 character limit. thanks for the help

    No.
    You can use the iPod in Disk mode and copy the outlines in their native format (Word?) and put them on your own computer.

  • Is there a way to get more trailer templates for iMovie on ipad?

    I don't have a mac, bot I love iMovies on the iPad. Is there a way to get more trailer templates? I noticed quite a few more on iMovie 11 and I just wanted to know if new ones would be made available for the iPad?

    actually, no 'add-ons' possible or avail for iMovie/MacOS/iOS…

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

  • What is the fastest way of getting data?

    With a scanning electron microscope, I need to scan a 512*512 pixel area with a pixel repetition of 15000 (two channels), meaning averaging over 15000 measurements. Simultaneously I have to adjust the voltage output for every pixel.
    I am using a 6111E Multifunction I/O board in a 800MHz P3. The whole task has do be done as fast as possible (not more than 20 minutes altogether).
    What is the fastest way to get this huge amount of data with averaging and output in between? (E.g. do I use buffered read with hardware triggering or is there a faster way?)

    Using the NI-DAQ API (not LabView) will give you a significant amount of more control over what happens and when to the data stream; which translates to a more efficient program. But you need to program in C/C++ or Delphi then. The Measurement Studio provides ActiveX controls that are like the LabView ones for C&C++ (they�re slow like the LabView ones though � not a lot you can do about the Windows GDI).
    What are you trying to sample 15000 times? The 512*512 pixel field?
    That�s almost 15Gigs of data! And it means you need to process data at 12.8MB/s to finish it in 20 minutes. I hope you know C, x86 assembly and MMX.
    I would setup a huge circular buffer (NI-DAQ calls them �double buffers�), about 30 seconds worth or so, to use with SCAN_Start. Then I would proces
    s the actual buffer the card is DMA�ing the data into with a high priority thread. Progressively sum the scan values from the 16bit buffer (the samples are only 12 bit, but the buffer should still be 16bits wide) into a secondary buffer of DWORDs the size of the screen (512*512), and you�ll need two of those, one for each channel. Once the 15000 scans are complete, convert each entry into a float divide by 15000.0f, and store it in a third buffer of floats.
    If you wish to contract this out, send me an email at [email protected]

  • Is the only way to get your money back for unauthorised purchases to go thru the lengthy email customer support process?

    I want my money back and I want it now. Why doesn't apple have a phone number for urgent account problems? i got an overdrawn fee from my bank, I checked the transactions and found apple iTunes charged me 11 times in one day with the total amount being over $170.00!!!!! The only purchases I made that day were a few $1.29 inapp purchases. How do I get my money back??? And why don't they have a phone number you can contact. This is an urgent problem because not only have they charged me over $170 & Ive got a $30 overdrawn fee there are MORE transactions from apple on my bank account that are "pending". These transactions are of a similar amount & they are not for anything I have purchased! i have been forced to cancel my credit card to stop apple from doing anymore but I want my money back!

    Thanks but unfortunately I don't have that option (I'm im Australia) so this will be day 8 that apple have my money without authorisation. The amount has now increased due to the transactions that were pending prior to me cancelling my credit card. The total is now over $300 including the overdrawn fee. It is beyond comprehension that a company the size of apple doesn't have a *real* customer service dept that handle these types of *real* problems immediately via phone contact but I guess that's the point isn't it? If we want to use the apps they provide thru their services and devices we have no choice but to put up with their primitive third world service. I sent them an email via the link you provided 4 days ago. There is no excuse for me to be STILL waiting for this problem to be resolved - none whatsoever, it is disgusting. Thanks for responding I had a feeling that was the only way to get this resolved, only it is so unbelievable I had to make sure.

Maybe you are looking for