RENAMING MNESIA TABES
Mon Dec 16 11:58:29 CET 2002
On Mon, 16 Dec 2002, Valentin wrote:
>This process has worked just fine so far, however, as it
>usually happens, we have underestimated the traffic
>volumes, and I am not sure if the process will cope with
>the load -- the export facility that I wrote is quite a
>slow one. I've been looking for a simple work-around, i.e.
>if the table can be renamed, I would have all the time in
>the world to do the export, etc.
You could perhaps steal an idea from the telephony realm,
where one usually keeps a NOP and an OP table for B-number
analysis. Basically, you keep two tables, and perform a
lookup on a record (in some other table) to determine which
of the two is active.
When you are ready to export data from one of the tables,
you update the "switch" record to point to another table,
and so on. It's also very similar to how a wrap log works.
Another way to go might be to use ets instead of mnesia. The
ets:rename/2 function does allow you to rename an ets table.
Ulf Wiger, Senior Specialist,
/ / / Architecture & Design of Carrier-Class Software
/ / / Strategic Product & System Management
/ / / Ericsson Telecom AB, ATM Multiservice Networks
More information about the erlang-questions