Congruence of documents and database nodes
Tuesday, 25 May 2010 · 2 messages
HO
Hans-Peter Oeri25 May 2010 13:42 #
Hi!
Within the documentation[1], you note that XQuery Updates are not reflected in the documents. There is an example of how to write queries that use
fn:put to do such an update manually.
Under the assumption that XQueries and updates are far more frequent than document puts/pulls, wouldn't an 'inversed' technique be favorable? One that updates "dirty" documents upon fetching them rather than updating with each and every query? (Plus, as far as I see, not needing manual fn:puts is more interoperable)
Unfortunately, such 'inversion' would not only need an update to the API classes, but also the "core" (as "dirty" documents would need to be flagged). Would that be a reason the current implementation got as it is? Or don't I see some other issue?
HPO
[1] http://www.inf.uni-konstanz.de/dbis/basex/xquery#updateCG
Christian Grün25 May 2010 14:05 #
Hans-Peter,
thanks for your interesting thoughts. Would you like to see the filesystem pulling dirty documents out of the database, or would you expect the database to perform updates on the filesystem if new queries are run against these documents?
To avoid
fn:put, we've added a WRITEBACK flag, which writes back databases after an update operation:
set writeback on; xquery ...
…but this is indeed not desirable if many updates are performed.
ChristianQuoted text · Hans-Peter Oeri · 21 lines
On Tue, May 25, 2010 at 1:42 PM, Hans-Peter Oeri <hp at oeri.ch> wrote: > Hi! > > Within the documentation[1], you note that XQuery Updates are not > reflected in the documents. There is an example of how to write queries > that use fn:put to do such an update manually. > > Under the assumption that XQueries and updates are far more frequent > than document puts/pulls, wouldn't an 'inversed' technique be favorable? > One that updates "dirty" documents upon fetching them rather than > updating with each and every query? (Plus, as far as I see, not needing > manual fn:puts is more interoperable) > > Unfortunately, such 'inversion' would not only need an update to the API > classes, but also the "core" (as "dirty" documents would need to be > flagged). Would that be a reason the current implementation got as it > is? Or don't I see some other issue? > > HPO > > [1] http://www.inf.uni-konstanz.de/dbis/basex/xquery#update
___________________________
Christian Gruen
Universitaet Konstanz
Department of Computer & Information Science
D-78457 Konstanz, Germany
Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577
http://www.inf.uni-konstanz.de/~gruen
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery