We’ve been struggling in one of our implementations (v1.11.x) with patient search, which takes over 30 seconds now to search for a patient with the number of records reaching 350k. Searching for a way to optimize this time (note that Lucene queries aren’t being used for patient search for versions 1.x), I was exploring possibilities to disable using Soundex function. I couldn’t find any. If that indeed is the case, I think it would be good to add a variable in advanced settings to switch using Soundex on and off.
Yes, Lucene queries were introduced for patient search later. Also, I benchmarked the query with and without Soundex, and Soundex found out to be a few ms faster regardless of data growth. Here are my findings:
With Soundex
Without Soundex
Records
Matches
Time(ms)
Matches
Time(ms)
100000
832
267
1171
280
200000
1032
161
1691
184
300000
1232
243
2211
263
400000
1432
315
2731
359
500000
1632
908
3251
990
The above results are from my laptop - (Core i7, 7500U, Windows 10-64 bit, MySQL v5.6)
Which did you run first? If you run two similar queries in most database engines,
the second one is nearly always quicker, because of disk/table caching.
Also the time per match is much less in the ‘Without Soundex’ table.
Yes, time per match has reduced, but from end-user perspective, it has actually increased. But I get your point, I guess I should repeat the experiment with query caching disabled.