Balanced compact clustering for efficient range queries in metric spaces