Changes

Jump to navigation Jump to search
21 bytes added ,  15:37, 21 July 2022
<syntaxhighlight lang="xquery">
STRIPWS: true
SERIALIZER: indent=noyes
</syntaxhighlight>
Several internal steps are performed when a query is executed (see [[XQuery Optimizations#Introduction|XQuery Optimizations]] for more details):
1. # The query is parsed, i.e., the original query string is transformed to an executable tree representation.2. # External values that are passed on by APIs are bound to variables and the query context. External values can be names of databases, or contribute to a name that will be assembled later on be constructed in the query.3. # The query is compiled and evaluated.
The [[Transaction_Management|transaction manager]] gathers the names of the databases that will be accessed by a query. If it is not possible to uniquely identify all databases that may be opened by the query, global locking will be applied, and all databases will be locked. Detection can fail if the names of databases depend on external input. It can also fail if a query is too complex to associate character strings with database operations.
Compilation The compilation phase has now been split into two separate steps:
# ''Compilation'' of logical, context-independent operations. External values are bound to the query, and deterministic code is rewritten, simplified and pre-evaluated.
# ''Optimization'' of physical, context-based operations. Addressed databases Databases are opened and checked for available indexes; current date/time is retrieved. The resulting code is further rewritten and optimized.
Lock detection will be performed after the first step, and the code resulting from this step offers much more insight into which specific databases need to be locked. As a result, local locks can be applied to many more queries than before, and many queries can now run in parallel. An example:
==Main-Memory Updates==
XQuery Updates Update provides constructs to [[XQuery Update#Main-Memory Updates|update XML nodes in main memory]]. The data structures for in-memory representations of XML resources have been revised, such that updates can be performed orders of magnitudes faster than before. With BaseX 9.x, the following query runs for 6-7 several minutes, whereas it can now be computed in 3 a few seconds:
<syntaxhighlight lang="xquery">
</syntaxhighlight>
The store is persistent: Its contents are written to diskif BaseX is shut down, and retrieved from disk again after a restart.
==Modules==
|-
| Return variable bindings of a job
| {{Function|Job|job:bindings}}
| ''new''
|-
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu