BaseXdb/basex — Issue #297: "optimize" command destroys path index
Author: jufius
Created: 2011-12-01 12:47:12+00:00
State: open

If the path index is already up to date, command "optimize" or xquery "db:optimize("test")" forces the path index to just contain the root node even if there are way more nodes in the database.

Example:

CREATE DATABASE test
insert node into doc("test")
OPTIMIZE
OPTIMIZE

After this, the node is no longer found because the path index indicates it doesn't exist, meaning the xquery expression "count(doc("test")/node())" evaluates as "0". I have tested all of this only in the BaseX GUI 7.0.2.

Please forgive the nested double quotes.