Skip to content

max_levenshtein_distance (integer)

This configuration parameter affects the behaviour of the LE_DST and DLE_DST functions.

These functions are very compute-intensive. The maximum distance (or "threshold") expected in a Levenshtein distance calculation can significantly impact runtime, enabling early termination, pruned search space and reduced memory usage.

This parameter changes the maximum distance for which you expect an accurate answer. The default value is -1 which means there is no limit.

For example, you may only want to check if the distance between two strings is greater than 5 characters; you don’t need to know what the real distance value is. In this case, set max_levenshtein_distance to 5. If the real distance between the two strings is less than or equal to 5, the function returns the real value. Otherwise, it returns an answer for the first comparison that is greater than 5 and stops processing.

See also max_levenshtein_string_size.