It's between a candidate and each of the three columns in each record.
I didn't get you.If it is the former then you only ever need do this once and store the result.
The matching routine is really fast.Have you profiled your code to make sure that it is not the hamming distance algorithm that is chewing the time? Don't waste time optimising something that is not the biggest problem.
My initial doubt was if I have to copy all database entry in memory and performing the matching there instead of doing n queries against the database.
Here we're using microsoft sql express 2005.It is possible to provide an extension to Sqlite to give it the hamming_distance function it does not currently have. This is will be more efficient than dragging the data through Qt's Sql layers but is obviously another bunch of APIs to learn.
Regards
Bookmarks