<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 8, 2016 at 2:51 PM, Rik Ribbers <span dir="ltr"><<a href="mailto:rik.ribbers@sidn.nl" target="_blank">rik.ribbers@sidn.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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…</blockquote></div><br></div><div class="gmail_extra">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.<br><br></div><div class="gmail_extra">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.<br></div><div class="gmail_extra"><br clear="all"><br>-- <br><div class="gmail_signature">J.</div>
</div></div>