Changes

Jump to navigation Jump to search
100 bytes added ,  10:44, 1 August 2022
==Compilation==
Several The compilation has been split up into multiple steps to improve locking. So far, several internal steps are were already performed when executing a query is executed (see [[XQuery Optimizations#Introduction|XQuery Optimizations]] for more details):
# The query is parsed, i.e., the original query string is transformed to an executable tree representation.
# 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.
The compilation phase has now been split into comprises two separate steps:
# ''Compilation'' of logical, context-independent (static) operations. External values are bound to the query, and deterministic code is rewritten, simplified and pre-evaluated.# ''Optimization'' of physical, context-based (dynamic) operations. 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:
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu