A database management system predicts a selectivity for database query
conditions requiring a join of records from different tables. The system
identifies at least one skewed value in a field specified in the join
condition, and constructs, for each skewed value, a set of hypothetical
query predicates in which the field specified in the join condition is
replaced with a constant equal to the skewed value. The system then
predicts the selectivity for the hypothetical predicates, using any
appropriate prediction technique. The selectivities of the hypothetical
predicates are used to predict a selectivity for the original query.