I have a multi-user database management system of about 1 million records, its structure is as below:
- Backend (MySQL)
- "DNames" table
- "Fullname" field
- "ID" field
- "DNames" table
- Frontend (MS Access)
- "levenshtein" function
- "lev" query
- "lev_dist" field (calculated levenshtein distance using function above, sorted asc)
- "Fullname" field
- "ID" field
- "srch" textbox in "result" form
My problem is that when I run the query (i.e. use "srch" textbox) without sorting it's fast enough, but when I use sort it takes about 30 to 90 sec to complete (depending on pc specs). I need the sort operation to find the top 10 (closest) match between the text in "srch" textbox and the database, so how can I speed up the process? Is there a way to make it reach 5 second max? This process may run from 5 PCs simultaneously. I tried using MySQL levenshtein function , yet it took 2 minuts!!