17. One or more non-transitory storage media storing instructions which, when executed by one or more processors, cause: storing summary data that (a) specifies a number of each element of a plurality of elements of an XML document that is part of XML data and (b) indicates a hierarchical relationship among the plurality of elements; identifying, in a particular query that targets a portion of the XML data, a plurality of predicates that comprises a first subset and a second subset that is different than the first subset; analyzing the summary data based on the first subset of the plurality of predicates; determining that at least a first predicate in the first subset of the plurality of predicates is correlated with a second predicate in the second subset of the plurality of predicates; in response to determining that the first predicate is correlated with the second predicate, generating a single selectivity value based on the first subset of the plurality of predicates, one or more predicates that do not belong to the first subset of the plurality of predicates, and the summary data; associating the single selectivity value with the first subset of the plurality predicates; and estimating, based on the single selectivity value, a cost of executing the particular query.
25. The one or more non-transitory storage media of claim 17 , wherein the second predicate indicates a particular path in the XML data and the first subset of the plurality of predicates are constrained to elements under the particular path.