dets improvements?

Hans Bolinder hans.bolinder@REDACTED
Fri Jun 16 09:32:30 CEST 2006


[Yariv Sadan:]
> > The major problem with Dets as I see it is that the memory allocation
> > scheme (a buddy system) is kept in RAM. For a fragmented table with
> > millions of objects, the RAM data can amount to several megabytes.
> 
> Is there any way <...> 2) to manage/reduce it via maintenance
> operations (preferably, without taking offline the whole
> database/table)?

I haven't tried this myself, but...

If you use Mnesia and 'disc_only_copies', then directly (or
indirectly, by changing the schema) calling mnesia:add_table_copy()
would create a defragmented copy of the Dets table on some other node.
While the table is being copied, the table can be updated as usual, at
some extra cost.

Best regards,

Hans Bolinder, Erlang/OTP



More information about the erlang-questions mailing list