[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Running XQuery using doc() and collection()

Wolfgang wolfgang at exist-db.org
Thu Jan 24 21:41:08 PST 2008


  Running XQuery using doc() and collection()
> I have set these files up on another server so now all the files have http://chausie.slis.indiana.edu:8080/exist/rest//db/foo/ in front of it all the the files within the doc() . The problem is that this is running at the speed of 10 seconds for 800KB of data parsing.

Is there a special reason for storing the documents on one machine while 
executing the query on another one? While this is basically possible, it 
is not efficient if you want to benefit from indexes etc. The data has 
to be retrieved and parsed before it can be queried. Instead, the query 
should run on the eXist server which contains the documents. Otherwise 
you don't need to store the documents into eXist at all.

> I have now switched the first statement from
> 
> let $addresses := (doc("1.xml") | doc("3.xml") |doc("4.xml") | doc("2.xml"))//bibl/p/address
> 
> to
> 
> let $addresses := (fn:collection("xmldb:exist://chausie.slis.indiana.edu:8080//db/resuml")//bibl/p/address)

I'm not sure if eXist supports this URI scheme within collection(). 
Again, I would recommend to run the query on the server. In this case, 
you don't need to specify a full URI since all relative URIs will be 
interpreted as being relative to the db. Thus

fn:collection("/db/resuml")//bibl/p/address

should be ok.

Wolfgang


Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.