Re: [bdbxml] collections

George Feinberg <[email protected]> Fri, 5 Aug 2005 12:27:17 -0400
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
> I have beem using eXist to investigate using an XML DB and I am now  
> looking for
> a more robust implmentation. I have tried to use the latest release  
> of Oracle
> that supports XQuery but it crashes when I try to run my query.  
> This either
> means that the Oracle XQuery support is not very good or the query  
> that I am
> doing is somehow problematic.
>
> I have a large number of very small (500 bytes) documents organized  
> in a
> hierarchy of collections (at least that is what they are called in  
> eXist) so the
> actual xml files are /x/y/foo.xml /x/y/foo2.xml /x/z/foo3.xml.
>
> In my query I need to be able to have something like "for $i in  
> collection(/x)"
> and have the query go across all 3 of the files or "for $i in  
> collection(/x/y)"
> and have it look at the 2 files. Either of these work fine in eXist  
> (if a little
> slowly) but the first doesn't work at all in Oracle and the second  
> results in an
> internal error maximum open cursors exceeded (there are several  
> hundred xml
> files in the collection when this happens).
>
> My question is can I do this easily with Berkeley DB XML? Is it  
> possible to make
> it perform?

Performance should not be an issue, if you create the right indexes
to narrow the searches.

As for hierarchical containers and naming, the argument to the  
collection()
function in XQuery is implementation defined.  eXist has chosen
to make collections hierarchical, but that is a product-specific choice.

BDB XML has a flat container name space.  An API to group containers
for convenience in querying has been proposed, but not yet implemented.
However, you can easily do what you want (query 1, 2 or 3 containers)  
using XQuery
itself.  For example, if you name your containers x, y, and z, you  
can do any
one of:
     for $i in collection('x') ...
     for $i in collection('y') ...
     for $i in (collection('x'),collection('y'))...
     for $i in (collection('x'),collection('z))...
     for $i in (collection('x'),collection('y'),collection('z'))...
etc.
You get the idea.

Regards,

George

>
> thanks
> Jim
>



------------------------------------------
To remove yourself from this list, send an
email to [email protected]