<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thank you Eric. I would ponder on that.<div class=""> <br class=""><div><blockquote type="cite" class=""><div class="">On 15-Jul-2016, at 17:10, Éric Pailleau <<a href="mailto:eric.pailleau@wanadoo.fr" class="">eric.pailleau@wanadoo.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Hi,<br class="">
I would probably add a record entry with second element of the UUID: xxxxxxxx-4c31-...<br class="">
43c1 here and add an index on it.<br class="">
It may increase speed a lot on big tables.<br class="">
This have to be tested however. <br class=""></p><p dir="ltr" class="">"Envoyé depuis mon mobile " Eric</p>
<br class=""><br class="">---- Chaitanya Chalasani a écrit ----<br class=""><br class="">I have a table with an UUID as the primary key / first element of the record. <div class=""><br class=""></div><div class="">What is the efficient way to check if a given set of UUIDs are valid primary key for that table. </div><div class=""><br class=""></div><div class="">I can think for three different solutions -</div><div class=""><ul class="MailOutline"><li class="">use mnesia:all_leys(TableName) and perform lists subset check. However, if the table contains over a million records, fetching all the keys for every check isn’t a nice solution.</li><li class="">use mnesia:read(TableName, Key) and check on the response. However, if the row is a big enough, trying to get the whole row for a simple key check isn’t that good either. </li><li class="">use ets:member(TableName, Key). A better solution than the above but doesn’t work on remote tables. </li></ul><div class=""><br class=""></div></div><div class="">Which one of the above is the least bad solution or is there a better one hidden under the documents. </div><div class=""><br class=""></div><div class="">/Chaitanya</div></div></blockquote></div><br class=""></div></body></html>