[erlang-questions] mnesia storage types

Noah Schwartz noah.schwartz1@REDACTED
Thu Mar 27 18:23:40 CET 2014


Hello,

We use mnesia fairly extensively in our application and are interested in
keeping track of table growth. We have one very big table thats already
sharded and want to know well ahead of time if/when others need to be
sharded.

We started with a fairly simple approach of calling mnesia:table_info(Tab,
memory) on each table on a regular interval. It seems that for
disc_only_tables mnesia defers to dets:info/2 and for disc_copies or
ram_copies mnesia defers to ets:info/2. dets returns the size in bytes and
ets returns the size in words. We noticed that the words returned by ets
didnt match up with the file sizes on disk when converted to bytes. This
got us wondering a little more about the different file types -- DAT for
dets and DCD/DCL for disc_copies. We also noticed that if you called
dets:info(Tab, memory) on a disc_copies table it returned undefined. I was
always under the impression that a disc_copies table used ets and dets
under the hood but, after looking at the mnesia code that doesn't seem like
the case.

So my first question is, do tables with a storage type of disc_copies use
dets? If so, are they limited by the same 4GB limit that dets is? If so,
how can I properly measure the size on disk of a disc_copies table.

Thanks in advance

-- 
Noah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140327/29451d00/attachment.htm>


More information about the erlang-questions mailing list