Press "Enter" to skip to content

DBSCAN in SQL Server

Sebastiao Pereira is a mad lad and I love it:

Is it possible to have the DBSCAN algorithm in SQL Server without the use of external tools? If so, can you please provide a working example?

DBSCAN is a neat algorithm for clustering and it is reasonably popular in the literature. I cannot imagine that it would perform well at all in SQL Server on a large dataset, though in fairness, I did try out the Mail_Customers example Sebastiao noted. This dataset includes 196 rows after you eliminate four duplicate combinations of annual income and spending score, and the procedure returned in less than a second. Now, getting the execution plan for this took a while, but it was neat to see this working.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.