Re: [basex-talk] Join

2019-11-29 Thread Giuseppe G. A. Celano
Hi Christian, Thank you very much for this detailed explanation! If I understand correctly, the index option, which makes everything faster, is an optimization that is independent from XQuery per se. This explains why it is activated only under certain circumstances, independently from the

Re: [basex-talk] Join

2019-11-28 Thread Christian Grün
Hi Giuseppe, Thanks for passing me on your data sets. Some background information: • If you look at the query info, you’ll see that your query won’t be rewritten for index access. • Without index access, your query will need to perform the impressive amount of 1440254 * 17573 = 25 billion

Re: [basex-talk] Join

2019-11-27 Thread Christian Grün
Could you additionally share some sample data with us, or indicate the skeleton/schema of your database documents? Thanks in advance Christian Giuseppe G. A. Celano schrieb am Do., 28. Nov. 2019, 01:45: > Hi, > > > I have the following query: > > count( > > for $r in

[basex-talk] Join

2019-11-27 Thread Giuseppe G. A. Celano
Hi, I have the following query: count( for $r in doc("hib_parses.xml")//row let $i := doc("hib_lemmas.xml")//row[field[@name="lemma_lang_id"][. = "3"]] where $r/field[@name="lemma_id"] = $i/field[@name="lemma_id"] return $r ) I have noticed that the where clause needs to be changed into

Re: [basex-talk] Join operation and the database

2017-07-27 Thread Christian Grün
Hi Giuseppe, > If I compare values just using one indexed string (the one in @v), this is > the fastest way (about one second on my machine). It depends on the value you are looking for. If it only occurs once in your database, the lookup will be very fast (in database terms, this is called a

Re: [basex-talk] Join operation and the database

2017-07-27 Thread Giuseppe Celano
Hi Christian, Let's recapitulate: If I compare values just using one indexed string (the one in @v), this is the fastest way (about one second on my machine). If I compare against two distinct indexed values, their order matters, in that -if I understand correctly- the database uses the index

Re: [basex-talk] Join operation and the database

2017-07-27 Thread Christian Grün
Hi Giuseppe, Thanks for the new query. If you have a look at the query info, you will see that your query will in fact be rewritten to take advantage from the index structures: for $t_2 in document-node {"tlg0001.tlg001.perseus-grc2.xml"}/*:text/*:s/*:t return db:text("splitted-db",

Re: [basex-talk] Join operation and the database

2017-07-27 Thread Giuseppe Celano
Hi Christian, These are the queries: (: This works :) declare variable $txts := doc("tlg0001.tlg001.perseus-grc2.xml"); declare variable $lemm := db:open("splitted-db"); (: see link sent earlier :) for $t in $txts//t let $match := $lemm//d[./@v = $t/@o || "#" || $t/text()] return $match (:

Re: [basex-talk] Join operation and the database

2017-07-27 Thread Christian Grün
Hi Giuseppe, It would be interesting to see how you declare $t and $lemm in your query, as this might influence the way how your query is rewritten. Could you possibly attach yet another query that can be successfully parsed? Thanks in advance, Christian PS: Glad to see that sending mails to

[basex-talk] Join operation and the database

2017-07-27 Thread Giuseppe Celano
Hi, I performed join operations between many files and a dictionary. The files contain tokenized texts, where one finds word forms + fine-grained POS tags. Look at the following file: