[erlang-questions] Mnesia Fragmented tables..... feature or bug?

Eranga Udesh <>
Mon Oct 16 14:24:50 CEST 2006



In a Fragmented Table, when I ran select/4, I get {Objects, Cont}. According
to the returned result, it looks to me that select only runs in the First
Table Fragment, even though the result count is less than the NObjects value
specified. However, if I iterate select/1 in the Cont returned until
'$end_of_table', I can get all the other results. I suppose select/4 should
do the iteration in all the Table Fragment, until the returned record count
becomes > NObjects. Is this a bug or feature in Mnesia Frag Access Module?


As an example, pls check the code snippet attached. To run it,

            Start Erlang:

            erl -sname test -mnesia dir "/tmp/mnesia_test'" -setcookie


            Initialize Db:



            Add some records to the Db:

            mnesia_test:save_retry(123456, 1000, 1, 1).

            mnesia_test:save_retry(124456, 1300, 2, 1).

            mnesia_test:save_retry(223456, 1040, 1, 14).

            mnesia_test:save_retry(123156, 1400, 1, 11).


            Dump all the Db Records:



            Do a select/3



            Do a single select/4



            Do a select/4 followed by subsequent calls to select/1 until



Please advice.



- Eranga


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061016/a2d9d035/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mnesia_test.erl
Type: application/octet-stream
Size: 7442 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061016/a2d9d035/attachment.obj>

More information about the erlang-questions mailing list