Changes

Jump to navigation Jump to search
97 bytes removed ,  15:52, 17 January 2016
no edit summary
==Name Index==
The name index contains all element and attribute names of a database, and the fixed-size index ids are stored in the main database table. If a database is updated, new names are automatically added. Furthermore, the index is enriched with statistical information, such as the distinct (categorical) or minimum and maximum values of its elements and attributes. The maximum number of categories to store per name can be changed via [[Options#MAXCATS|MAXCATS]]. The statistics index are discarded after database updates and can be recreated with the [[Commands#OPTIMIZEUpdates|OPTIMIZEdatabase updates]] command.
The name index is e.g. applied to pre-evaluate location steps that will never yield results:
==Path Index==
The path index (also called ''path summary'') stores all distinct paths of the documents in the database. It contains the same similar statistical information as the name index. The statistics index are discarded after database updates and can be recreated with the [[Commands#OPTIMIZEUpdates|OPTIMIZEdatabase updates]] command.
The path index is applied to rewrite descendant steps to multiple child steps. Child steps can be evaluated faster, as fewer nodes have to be accessed:
Updates in BaseX are generally very fast, because the index structures will be invalidated by updates. As a result, subsequent queries may be executed more slowly than before the update. There are different alternatives to cope with this:
* After the execution of one or more update operations, the <code>[[Commands#OPTIMIZE|OPTIMIZE]] </code> command or the [[Database Module#db:optimize|db:optimize]] function can be called to rebuild the index structures.* The [[Options#UPDINDEX|UPDINDEX]] option can be activated before creating or optimizing the database. As a result, the text and attribute index structures will be incrementally updated after each database update. Please note that incremental updates are not available for the token index, full-text index, and database statistics. This is also explains why the up-to-date flag, which is e.g. displayed via <code>[[Commands#INFO DB|INFO DB]] </code> or [[Database_Module#db:info|db:info]], will be set to {{Code|false}} until the database will be optimized again.
* The [[Options#AUTOOPTIMIZE|AUTOOPTIMIZE]] option can be enabled before creating or optimizing the database. All outdated index structures and statistics will then be recreated after each database update. This option should only be used for small and medium-sized databases.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu