9. A computer-readable storage medium that stores instructions which, when executed by one or more processors, cause: identifying at least one path expression in a particular query that does not match an index definition path expression for a particular structured index; in response to identifying the at least one path expression in the particular query that does not match an index definition path expression for the particular structured index: based on identifying a common context between two or more path expressions of a first set of path expressions, forming a fused path expression from the two or more path expressions; wherein the particular query includes the path expressions of the first set; determining that the fused path expression matches an index definition path expression for the particular structured index; and in response to determining that the fused path expression matches an index definition path expression for the particular structured index: rewriting the particular query to include a subquery on the particular structured index; wherein the subquery is configured to retrieve, from the particular structured index, information referred to in the fused path expression.
9. A computer-readable storage medium that stores instructions which, when executed by one or more processors, cause: identifying at least one path expression in a particular query that does not match an index definition path expression for a particular structured index; in response to identifying the at least one path expression in the particular query that does not match an index definition path expression for the particular structured index: based on identifying a common context between two or more path expressions of a first set of path expressions, forming a fused path expression from the two or more path expressions; wherein the particular query includes the path expressions of the first set; determining that the fused path expression matches an index definition path expression for the particular structured index; and in response to determining that the fused path expression matches an index definition path expression for the particular structured index: rewriting the particular query to include a subquery on the particular structured index; wherein the subquery is configured to retrieve, from the particular structured index, information referred to in the fused path expression. 14. The computer-readable storage medium of claim 9 wherein the step of forming a fused path expression from the two or more path expressions further comprises: concatenating the two or more path expressions without duplicating the one common context.