Geometric Approach to Clustering and Querying in Databases and Warehouses