Search code examples
phpmysqllevenshtein-distance

Is Levenshtein slow in MySQL?


Yesterday I had a question where people suggested I use Levenshtein method. Is it a slow query? Maybe I can use something else?


Solution

  • You can use the BENCHMARK function to test the performance:

    SELECT BENCHMARK(10000, LEVENSHTEIN('abc', 'abd'));
    

    Maybe test it with different strings similar to your use case.