What is slowing down classic DBSCAN algorithm How to apply CSR Matrix on DBSCAN algorithm in python without using any libraries?

Update: Matrix size (8580, 126356)

I have given a shot and implemented the algorithm. It runs rather slow. I guess its because regionQuery function calculates the euclidean distance  between a chosen point and every other point in the dataset. 

Is there any way this problem can be solved?
Write the DBSCAN code yourself.
Run the code.
Observe that your code likely will be a lot slower than the libraries code.