14. The system of claim 13 , wherein the machine-readable program code further includes instructions for receiving match query and determining whether the query is a full string match query type or a sub-string match query type, and includes instructions such that (i) if the match query is determined as being a full string match query type, then finding the appropriate bucket using maximum a posterior probability, and (ii) if the match query is determined as being sub-string match query type then (a) estimating the frequency of the sub-string in each bucket, and (b) computing a weighted sum of bucket selectivity based on said frequency.
14. The system of claim 13 , wherein the machine-readable program code further includes instructions for receiving match query and determining whether the query is a full string match query type or a sub-string match query type, and includes instructions such that (i) if the match query is determined as being a full string match query type, then finding the appropriate bucket using maximum a posterior probability, and (ii) if the match query is determined as being sub-string match query type then (a) estimating the frequency of the sub-string in each bucket, and (b) computing a weighted sum of bucket selectivity based on said frequency. 15. The system of claim 14 , wherein the instructions for constructing a histogram include: instructions for counting each attribute-value pair in the document; instructions for outputting a collection of attribute-value-count triples sorted by said counting; and instructions for partitioning the collection of sorted attribute-value-count triples into said buckets.