Changes

Jump to navigation Jump to search
325 bytes added ,  15:18, 17 April 2012
no edit summary
This article is part of the [[Advanced User's Guide]] and introduces the available index structures, which are utilized by the query optimizer to rewrite expressions and speed up query evaluation.
The Nearly all examples in this article are based on the [http://files.basex.org/xml/factbook.xml factbook.xml] document. To see how a query is rewritten, please turn on the [[GUI#Visualizations|Info View]] in the GUI or use the [[Startup_Options#BaseX_Standalone|-V flag]] on command line.
=Structural Indexes=
==Text Index==
This index speeds up string-based equality tests and (since {{Version|7.2.1}}) range queries on text nodes. The [[Options#UPDINDEX|UPDINDEX]] option can be activated to keep this index up-to-date.
The following queries will all be rewritten for index access:
//*[text() = 'Germany'],
doc('factbook.xml')//name[. = 'Germany'],
for $c in db:open('factbook')//country[.where $c//city/name = 'Hanoi'return $c/name</pre> Since {{Version|7.2.1}}), the text index also supports range queries based on string comparisons: <pre class="brush:xquery"> db:open('Library')//Medium[Year >= '2005' and Year <= '2007'],let $min := '2011-04-16T00:00:00'let $max := '2011-04-19T23:59:59' return db:open('news')//nameentry[date-time > $min and date-time < $max]
</pre>
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu