What are the main performance bottlenecks when scaling DBSCAN to millions of data points?

Last updated 11 November 2026

  • The main cost is one eps-range query per point: O(n²) brute force, or about O(n log n) with KD/ball trees in low dimensions (degrading in high dimensions).

  • Storing precomputed neighborhoods (or a distance matrix) explodes memory. Cluster expansion is a sequential graph traversal, so distributed versions need partitioning, halo points and merging.

  • Mitigations: tree indexes, deduplication with sample_weight, approximate or GPU variants (e.g. cuML), dimensionality reduction, or HDBSCAN to avoid repeated eps sweeps.

  • https://arxiv.org/html/2411.11421v3
  • https://builtin.com/articles/dbscan
  • https://ujangriswanto08.medium.com/what-is-dbscan-with-r-tree-indexing-a-faster-approach-to-clustering-7a3aec1d86a3
All Clustering interview questions