Yes, you're right. We're not using SQL queries at the moment as that would be very inefficient, it was just as an example for a small dataset.
I'm currently researching MVP's and reading on VP-trees, BK-trees [1], GNAT [2] and HEngine [3]. Do you have any advice?
[1] http://blog.notdot.net/2007/4/Damn-Cool-Algorithms-Part-1-BK...
[2] http://www.vldb.org/conf/1995/P574.PDF
[3] https://www.cse.msu.edu/~alexliu/publications/HammingQuery/H...