One use case where this might be a problem is when you want all of your queries compiled at your application start time (using QueryProcessor::compile()). This is a speed/CPU load issue.
This is something we want to tackle within the query processor architecture: query modules that are requested multiple times will automatically be cached and reused. As you may have seen, however, parsing and compilation time is usually pretty fast unless the number of linked library modules isn’t that extensive.
It would be interesting to hear if you (or someone else) has already encountered a real bottleneck of the current client/server architecture or the XQuery parsing/compilation step?
Christian ___________________________
On Fri, Apr 12, 2013 at 5:03 PM, Stu Salsbury stu.salsbury@gmail.com wrote:
Please tell me I'm wrong it this is done automagically for modules stored in the database, but my impression is it doesn't happen until you call compile or execute (which calls compile).
I'm working in Java and plan to use Apache Commons Pool to store a bunch of sessions with associated start-time-compiled queries for the threads of my website requests. Can anyone see any problems with this approach?
On Fri, Apr 12, 2013 at 1:30 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Michael,
I didn’t check how the client API works in details, but is it made in such a way that only one query at a time can be sent? Should I use a new Session instance for every single query sent to the server?
exactly, that’s the way our sessions work: If you want to run queries in parallel, you’ll have to create multiple sessions. In the use cases we are familiar with, this works out fine, because creating a new session is a pretty light-weight operation.
Hope this helps, Christian _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk