Http: database creation

Tuesday, 13 October 2015 · 2 messages · last reply 14 Oct 2015
M
meumapple13 Oct 2015 20:41 #
Hi, I have developed with RESTXQ a web application that compares texts (the user specifies the urls of two texts in a form and the computation is performed with their submission). It works but it is too slow if the texts are relatively long (before the actual comparison I pre-process the texts deleting and adding nodes via transform expressions). I am not sure what the cause is, but I was wondering whether everything would be faster if I created a database with the texts and then applied the queries. If so, how is it possible to a allow one click submission (via RESTXQ or REST) to create a DB and then open it and perform queries on it, since the database creation -if I am not wrong- cannot be associated with other operations within the same query? Thanks. J.
CG
Christian Grün14 Oct 2015 00:06 #
Hi J., You are right, it's not possible to create a database and query on it in a single XQuery expression. You'll need to create the database and use a redirect to trigger the evaluation of a second function [1]. However, before integrating such a two-phase evaluation in your application, I would recommend you to first do some testing. Maybe the use of database instances doesn't really help; maybe the query itself needs to be rewritten. Best, Christian [1] http://docs.basex.org/wiki/RESTXQ#Forwards_and_Redirects
Quoted text · meumapple · 8 lines
On Tue, Oct 13, 2015 at 8:41 PM, meumapple <meumapple at gmail.com> wrote: > Hi, > > I have developed with RESTXQ a web application that compares texts (the user specifies the urls of two texts in a form and the computation is performed with their submission). It works but it is too slow if the texts are relatively long (before the actual comparison I pre-process the texts deleting and adding nodes via transform expressions). > > I am not sure what the cause is, but I was wondering whether everything would be faster if I created a database with the texts and then applied the queries. If so, how is it possible to a allow one click submission (via RESTXQ or REST) to create a DB and then open it and perform queries on it, since the database creation -if I am not wrong- cannot be associated with other operations within the same query? Thanks. > > J.

⚡Generated with XQuery