Hi Marco,
Would I possibly solve the issue by importing an .xqm file that I generate offline with all the database names?
Yes, that's surely an option. One more solution is to use xquery:eval for each database.
Hope this helps, Christian
Maybe one could think of recognizing somehow that a query wants to query ALL the available databases and this should be equivalent of knowing the database names at compile time. Don't have any other clue ... Bye, M.
From: Christian Grün christian.gruen@gmail.com Sent: Saturday, October 3, 2015 10:27 AM To: Marco Lettere Cc: BaseX Subject: Re: [basex-talk] Hitting index for multi-db query
Hi Marco
Sorry, not at the moment. To trigger our index optimizations, the addressed database must be opened at compile time.
Maybe we could introduce pragma expressions or a new global option that enforces index access whenever possible, but it's getting tricky as soon as a query may be optimizable in different ways (an example /a[@b = 'c']/d[text() ='e']). I'll have some more thoughts. If you have some suggestions on how a good extension could look like, your feedback is welcome!
Christian
On Fri, Oct 2, 2015 at 11:55 PM, Marco Lettere marco.lettere@dedalus.eu wrote:
Hello all,
I have to query all the databases on one server for docs matching a query.
I do it with this query for example:
db:list() ! db: open(.)/entry[@about='abc']
This query never hits the available attribute index.
I could rewrite the query to something like
db:list() ! attribute(., 'abc', 'about')/..
and in this case it takes advantage of the index of course.
The problem is that I have to implement more queries which have much more generic predicate structures where I probably won't be able to use indexes explicitly.
Is there any possibility to rewrite this query in order to use the indexes implicitly?
Thanks,
Marco.