[erlang-questions] slow mnesia query

Éric Pailleau eric.pailleau@REDACTED
Fri Jan 8 18:28:50 CET 2016


Hello 
À native Erlang soundex / metaphone library would be nice to index some string key.
Unfortunately I m not sure it does exists...


Le 8 janv. 2016 3:48 PM, Jesper Louis Andersen <jesper.louis.andersen@REDACTED> a écrit :
>
>
> On Fri, Jan 8, 2016 at 2:51 PM, Rik Ribbers <rik.ribbers@REDACTED> wrote:
>>
>> The code is working it does what is should do, however it does not perform very well… I guess this does have to do with the string:str comparison that needs to go over all records every time. This shouldn’t be that hard to optimise for performance, however I don’t have any idea how…
>
>
> One prerequisite is that you need an ordered_set table. A standard table hashes the keys, so it is forced to visit all entries since it cannot use the index as a constraint. For an ordered_set table on a string, the lexicographic ordering of the string contents are indexed, so there the prefix is a possible match.
>
> To get this to work, however, you would have to coerce qlc and mnesia that the index is available, so it is only half the battle won.
>
>
> -- 
> J.


More information about the erlang-questions mailing list