A characterization of hierarchical computable distance functions for data warehouse systems