Mnesia tables: load times and sizes after deletion

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mnesia tables: load times and sizes after deletion

Ulf Wiger (AL/EAB)

Are you sure the tables were created under R9B?
If so, are you sure they are dets files (.DAT when using
mnesia)?

Granted, I've been on a long vacation and my brain may not
have engaged fully yet, but I recall that disc_copies are
stored on disk in disk_log format (mnesia gives them the
extension .DCD), and not as dets files. Disc_only copies
are stored as dets files.

The file size should adjust at every log dump,
and a load time of minutes seems a bit slow, perhaps, but
I wouldn't want to swear that it's abnormal.

/Uffe

-----Original Message-----
From: Bruce Fitzsimons [mailto:Bruce]
Sent: Thursday, August 14, 2003 14:07
To: erlang-questions
Subject: Mnesia tables: load times and sizes after deletion


Gentlemen,

I've just been playing with my little jukebox I wrote for broadcasting
background music in Erlang. It logs the songs played into an mnesia table
'playlog' (set, disc_copies).

I managed to get 71,000 entries into the table, at which point it took a
number of minutes to open on my little Duron 1300 w/ ATA100 hd

I used a (inefficient) mnemosyne query to get all the entries older than 1
day and delete them, and this worked. Surprisingly fast, to mnemosynes
credit.

What did surprise me is that the on-disk size, and the size reported by
mnesia:table_info(playlog, size) continued to increased (it was still
playing).

Is this normal? The docs say size = total number of records, is it actually
max size? Even after the delete and normal shutdown the table did not shrink
in either sense. It still took a number of minutes to open too.

I guess I'm just curious to know if this is normal?

I attempted to directly open the mnesia files under dets to query them...but
that is apparently not allowed. A good thing probably.

Thanks for any info. I've deleted and recreated the table now. This is all
under R9C (nice work guys, great docs), although the DB was created using
R9B-1.

/Bruce



Reply | Threaded
Open this post in threaded view
|

Mnesia tables: load times and sizes after deletion

Bruce Fitzsimons-2
Hi Ulf,

> Are you sure the tables were created under R9B?
> If so, are you sure they are dets files (.DAT when using
> mnesia)?

Ahhh....no they are disk logs, as you said.

> Granted, I've been on a long vacation and my brain may not
> have engaged fully yet, but I recall that disc_copies are
> stored on disk in disk_log format (mnesia gives them the
> extension .DCD), and not as dets files. Disc_only copies
> are stored as dets files.

Your brain is fine. I wasn't aware that the options had such a dramatic
difference in implementation. Its is good to know.

> The file size should adjust at every log dump,
> and a load time of minutes seems a bit slow, perhaps, but
> I wouldn't want to swear that it's abnormal.

How can I force a log dump? Do they happen periodically under Mnesia or do I
need to initiate a backup or something? I've never seen the internals of
Mnesia documented to this extent (although whenever I say this it is
immediately pointed out in the place I've been looking...).

Thanks for the help.

/Bruce




Reply | Threaded
Open this post in threaded view
|

Mnesia tables: load times and sizes after deletion

Dan Gudmundsson-4
Bruce Fitzsimons writes:
 >
 > > The file size should adjust at every log dump,
 > > and a load time of minutes seems a bit slow, perhaps, but
 > > I wouldn't want to swear that it's abnormal.
 >
 > How can I force a log dump?

mnesia:dump_log()

 > Do they happen periodically under Mnesia or do I
 > need to initiate a backup or something?

Default it's every thousend write or third minute if I remember correctly.
But that moves the updates (for disc_copies) to another log TAB.DCL which
contains the table specific updates. A new DCD file is generated when
the DCL is larger than 1/4 of the DCD size.

 > I've never seen the internals of
 > Mnesia documented to this extent (although whenever I say this it is
 > immediately pointed out in the place I've been looking...).
 >
 > Thanks for the help.
 >
 > /Bruce
 >