|
From: <wma...@AV...> - 2006-03-03 15:53:36
|
Hello. I'm actually trying to test eXist update/query capabilities and wanted = to make things right. Here are some newbie questions that may help me: 1. In one scenario, I have a document stored in the database, and a = string in Java containing a document with some <a> element as a = children. I need to insert all <a> in the document into the stored = document. I'm actually storing the document in the string into a = temporal document in the database, and passing to the query its = name($source_doc), so the query would look like: for $n in fn:doc($source_doc)//a return update insert $n into fn:doc($dest_doc)//father_of_a=20 I've read messages from 2004 saying there is problem passing nodes from = Java to be queried. Is that solved? Does it affect the above scenario? = Since I have the string to start with, what would the be best approach = for performance: parsing String to DOM and passing the dom, or doing it = like I'm doing it (storing the string as a document and then query = between persisted documents)? Also, I should stored the document in the string at each run, but I'm = simply storing using the same name of the temporal document, thus = replacing it. Would it be better to delete the document at the end of = the call so the next call will put a new document in? I ask this to know = if a replace is less efficient than a delete/insert procedure. 2. I'm actually running the queries (as small and simple as the one in = point 1) using a compiled query (exQryService.compile(sQuery)). There is = the option to store a module (*.xq file) and perform imports. Since that = would need in java also a query to be created (doing the import and = performing the call to the function), I wonder which of the two = approaches would give me the best performance (having the code in = compiled queries or having it in modules). Note that the scenario will = perform that query several times (call the query from Java). 3. Are there any tips/tricks to improve performance in the following = scenarios? a. Inserting big XML documents. b. inserting/deleting/replacing elements that are 6-10 levels deep in = the hierarchy. c. Query elements that are 6-10 levels deep in the hierarchy based on an = element's content value. d. Returning big XML documents. Thanks for your help!. _______________________________ William Mart=EDnez Pomares Architect Avantica Technologies |