[erlang-questions] mnesia bags vs sets containing lists

Evans, Matthew <>
Fri Mar 18 16:08:10 CET 2011

For the most parts you're probably not going to notice much between the two.

What I have noticed with tables of type bag is when the bag gets large then the performance will really slow down, especially on inserts. 

-----Original Message-----
From:  [mailto:] On Behalf Of Dave Challis
Sent: Friday, March 18, 2011 11:03 AM
To: erlang-questions
Subject: [erlang-questions] mnesia bags vs sets containing lists

Assuming I wanted to store some simple data structures in mnesia, of the 

{Key, [A, B, C, D, E, ...]}.

in which I don't care about the ordering of the list.

What would be the advantages/disadvantages of storing it using:

a) a table of type set, storing/retrieving the whole list at once, and 
operating on the list to get specific elements

b) a table of type bag, storing/retrieving individual values using mnesia

I'm just trying to get a feel for the differences in the above two 
implementations, rather than having any concrete use in mind.


Dave Challis

erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:

More information about the erlang-questions mailing list