Question

I have a scenario wherein my Xpath is being generated dynamically and placed into XMLTable function.

I have tested my XMLTable query with static Xpaths on Structured and Binary XML storage DB environments and both deliver good performance when I am not doing any indexing.

Now I want to further improve my performance in either of the environments and want to build Structured XMLIndex. I read in XDB Developers guide that Structured XMLIndex will only be useful when you know in advance what your Xpath will be and it does not change. Can someone provide more information as if its possible to use Structured XMLIndex on Structured/Binary XML environment where the Xpath changes dynamically. Any expample of that would be very helpful for me as I cannot find any such example on XDB Deveoper's guide.

Thanks.

Was it helpful?

Solution

A dynamically generated XPath should be fine, according to the Oracle 11.2 documentation:

You need no prior knowledge of the XPath expressions that might be used in queries. The unstructured component of an XMLIndex index can be completely general.

I imagine this would be of use as well:

If you have prior knowledge of the XPath expressions to be used in queries, then you can improve performance either by using a structured XMLIndex component that targets fixed, structured islands of data that are queried often.

Source: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_indexing.htm#CHDDCBJD

Note that you can have both structured and unstructured components.

From reading the documentation in general, my understanding is that it is more advantageous to know the structure of the XML data, and the likely XPath routes.

If the XPath is truly completely different every time then indexing probably isn't going to help you that much. If the dynamic bit is not actually very different, then you should see some performance wins.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top