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 fact that two XQuery expressions 
are supposed to return the same result. Thanks.

Best,
Giuseppe



> On Nov 28, 2019, at 5:54 PM, Christian Grün  wrote:
> 
> 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 comparisons.
> 
> • The optimized version of the query with text() steps can be
> evaluated much faster, as it utilizes both the text and the attribute
> index:
> 
>  db:text("hib_parses", db:attribute("hib_lemmas", "lemma_id") 
> /parent::row)
> 
> • A and A/text() cannot be treated identically by the query processor:
> A text node may have more than one text node (an example:
> a<_/>b). The atomized result will always be a single value,
> whereas A/text() will give you two values.
> 
> • In some cases, the optimizer will implicitly add text nodes to path
> expressions if it’s a) possible at compile time to determine that a
> given step has only single text nodes, and b) the query will not yield
> different results. In the next step, paths with trailing text() steps
> may then be rewritten for index access.
> 
> • Some optimizations are restricted to documents without namespaces.
> Adding the text() step is one of them, so this could be the reason why
> you need to add this step manually.
> 
> Hope this helps,
> Christian
> 
> PS: I will see if there’s a chance to enable the discussed
> optimization for documents with namespaces.
> 
> 
> 
> On Thu, Nov 28, 2019 at 1:45 AM Giuseppe G. A. Celano
>  wrote:
>> 
>> 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 
>> $r/field[@name="lemma_id"]/text() = $i/field[@name="lemma_id"]/text() in 
>> order to get a result (otherwise the query seems to never end).
>> I am wondering whether this is a BaseX issue, in that I would assume that 
>> the two kinds of where clause are equivalent (because of atomization). I 
>> have also noticed that /data() does not work either. Thanks!
>> 
>> Best,
>> Giuseppe
> 



Re: [basex-talk] BaseX 9.3: The Winter Edition

2019-11-29 Thread Marco Lettere

Thank you all so much!
The list of improvements is really impressive!
Great job as usual.
M.

On 29/11/19 17:14, Christian Grün wrote:

Hello to our loyal readers of our list,

We are glad to announce version 9.3 of BaseX, our XML framework,
database system and XQuery 3.1 processor:

   http://basex.org/

The focus has been put on in-depth optimizations of complex XQuery
code and faster processing of RESTXQ web applications:

RESTXQ
- seamless streaming of custom responses to the client
- Request Module: bind attributes to current request
- better support for the OPTIONS and HEAD methods
- trace output is now stored in the database logs
- enforce premature HTTP response with web:error
- optional GZIP compression of HTTP responses
- server-side forwarding with web:forward

USER INTERFACES
- GUI: project view: skip directories with .ignore file
- GUI: project view: do now follow symbolic links
- DBA: user panel updated to show user info
- DBA: faster processing of log entries

STORAGE
- hot fix for replacing single documents with namespaces
- improved XQuery processing of binary resources
- ADDCACHE: faster caching of single documents
- WITHDB: less locking when using fn:doc

XQUERY FUNCTIONS
- user:info/user:update-info: process user-specific data
- db:open-id, db:open-pre: support for multiple ids
- file:descendants: return descendant file paths
- inspect:type: return type of a value as string
- db:alter-backup: rename database backups
- xslt:transform: support for catalog files

XQUERY PERFORMANCE
- merge of adjacent/redundant steps in paths and predicates
- removal of redundant switch, typeswitch and catch clauses
- interruption of side-effecting code (Files Modul etc.)
- fn:count: pre-evaluation of zero-or-one arguments
- faster processing of alternative steps: a/(b,c)
- rewriting of paths to simple map expressions
- inlining of values in simple map expressions
- flattening of nested simple map expressions
- rewriting of lists to union expressions
- removal of superfluous predicates

For a more comprehensive list of added and updated features. please
check out our documentation: http://docs.basex.org/.

Your feedback is welcome as usual.

Have fun with the new release,
Your BaseX Team





Re: [basex-talk] BaseX 9.3: The Winter Edition

2019-11-29 Thread Bridger Dyson-Smith
Christian, and the BaseX Team -

Congratulations on the new release!
Thank you for all of your time and efforts.

Best,
Bridger

On Fri, Nov 29, 2019 at 11:14 AM Christian Grün  wrote:

> Hello to our loyal readers of our list,
>
> We are glad to announce version 9.3 of BaseX, our XML framework,
> database system and XQuery 3.1 processor:
>
>   http://basex.org/
>
> The focus has been put on in-depth optimizations of complex XQuery
> code and faster processing of RESTXQ web applications:
>
> RESTXQ
> - seamless streaming of custom responses to the client
> - Request Module: bind attributes to current request
> - better support for the OPTIONS and HEAD methods
> - trace output is now stored in the database logs
> - enforce premature HTTP response with web:error
> - optional GZIP compression of HTTP responses
> - server-side forwarding with web:forward
>
> USER INTERFACES
> - GUI: project view: skip directories with .ignore file
> - GUI: project view: do now follow symbolic links
> - DBA: user panel updated to show user info
> - DBA: faster processing of log entries
>
> STORAGE
> - hot fix for replacing single documents with namespaces
> - improved XQuery processing of binary resources
> - ADDCACHE: faster caching of single documents
> - WITHDB: less locking when using fn:doc
>
> XQUERY FUNCTIONS
> - user:info/user:update-info: process user-specific data
> - db:open-id, db:open-pre: support for multiple ids
> - file:descendants: return descendant file paths
> - inspect:type: return type of a value as string
> - db:alter-backup: rename database backups
> - xslt:transform: support for catalog files
>
> XQUERY PERFORMANCE
> - merge of adjacent/redundant steps in paths and predicates
> - removal of redundant switch, typeswitch and catch clauses
> - interruption of side-effecting code (Files Modul etc.)
> - fn:count: pre-evaluation of zero-or-one arguments
> - faster processing of alternative steps: a/(b,c)
> - rewriting of paths to simple map expressions
> - inlining of values in simple map expressions
> - flattening of nested simple map expressions
> - rewriting of lists to union expressions
> - removal of superfluous predicates
>
> For a more comprehensive list of added and updated features. please
> check out our documentation: http://docs.basex.org/.
>
> Your feedback is welcome as usual.
>
> Have fun with the new release,
> Your BaseX Team
>


[basex-talk] BaseX 9.3: The Winter Edition

2019-11-29 Thread Christian Grün
Hello to our loyal readers of our list,

We are glad to announce version 9.3 of BaseX, our XML framework,
database system and XQuery 3.1 processor:

  http://basex.org/

The focus has been put on in-depth optimizations of complex XQuery
code and faster processing of RESTXQ web applications:

RESTXQ
- seamless streaming of custom responses to the client
- Request Module: bind attributes to current request
- better support for the OPTIONS and HEAD methods
- trace output is now stored in the database logs
- enforce premature HTTP response with web:error
- optional GZIP compression of HTTP responses
- server-side forwarding with web:forward

USER INTERFACES
- GUI: project view: skip directories with .ignore file
- GUI: project view: do now follow symbolic links
- DBA: user panel updated to show user info
- DBA: faster processing of log entries

STORAGE
- hot fix for replacing single documents with namespaces
- improved XQuery processing of binary resources
- ADDCACHE: faster caching of single documents
- WITHDB: less locking when using fn:doc

XQUERY FUNCTIONS
- user:info/user:update-info: process user-specific data
- db:open-id, db:open-pre: support for multiple ids
- file:descendants: return descendant file paths
- inspect:type: return type of a value as string
- db:alter-backup: rename database backups
- xslt:transform: support for catalog files

XQUERY PERFORMANCE
- merge of adjacent/redundant steps in paths and predicates
- removal of redundant switch, typeswitch and catch clauses
- interruption of side-effecting code (Files Modul etc.)
- fn:count: pre-evaluation of zero-or-one arguments
- faster processing of alternative steps: a/(b,c)
- rewriting of paths to simple map expressions
- inlining of values in simple map expressions
- flattening of nested simple map expressions
- rewriting of lists to union expressions
- removal of superfluous predicates

For a more comprehensive list of added and updated features. please
check out our documentation: http://docs.basex.org/.

Your feedback is welcome as usual.

Have fun with the new release,
Your BaseX Team