Changes

Jump to navigation Jump to search
166 bytes added ,  16:10, 20 February 2018
=Pragmas=
A [[Options|local database option]] can also be assigned locally via a pragma. Examples:==BaseX Pragmas==
* Whitespace chopping Many optimizations in BaseX will only be performed if an expression is disabled for a particular document ''deterministic'' (see {{Option|CHOP}}i. e., if it always yields the same output and does not have side effects). By flagging an expression as non-deterministic, optimizations and query rewritings can be suppressed:
<pre class="brush:xquery">
sum( (# dbbasex:chop false non-deterministic #) { doc('doc.xml' 1 to 100000000}) }
</pre>
This pragma can be helpful when debugging your code. ==Database Pragmas== All [[Options|local database options]] can be assigned via pragmas. Some examples: * {{Version|9.0}}: Enforce query to be rewritten for index rewriting access. This can e. g. be helpful if the name of a database name is not static (see [[Indexes#Enforce Rewritings|Enforce Rewritings]] for more examples):
<pre class="brush:xquery">
}
)
</pre>
 
Many optimizations and query rewritings can be disabled by marking an expression as non-deterministic:
 
<pre class="brush:xquery">
count( (# basex:non-deterministic #) { 1 to 10 })
</pre>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu