[erlang-questions] Mnesia 25MB database takes 15min to load!!!

Scott Lystig Fritchie fritchie@REDACTED
Thu Oct 8 23:26:21 CEST 2009


Paul Fisher <pfisher@REDACTED> wrote:

pf> Do you have a secondary index defined on the table?  I have seem
pf> similar behavior when a secondary index is defined, and have changed
pf> our designs to not use them at all.  Without, disk_copies tables
pf> load at disk i/o speed.

Mnesia secondary indexes are great, until you have a secondary index key
that occurs in lots of records.  Secondary keys are implemented using
ETS 'bag'/'duplicate_bag' (I can never remember, sorry).  Inserting the
same key repeatedly into the secondary index ETS table will get you
O(N^2) behavior.

See this long thread for more details:

    http://erlang.org/pipermail/erlang-questions/2008-June/035745.html

-Scott


More information about the erlang-questions mailing list