I have a table A of type disc_copies. It has two files on the disk.
As per my understanding, A.DCL is log file and A.DCD has all the data. Today I have done multiple operations on A, however A.DCD remains same but size of A.DCL was increased. When my application starts how this table gets stored in ram when DCD file is not changed. Proper Documentation is not available, so can anyone tell what is the exact process ? Also DCD file gets very large over the time even though there is no data in the table, can anyone clarify ?
For a disc_copies table, the data is read into an ETS table when Mnesia starts, so the whole table exists in RAM. The DCD is the latest full snapshot, and the DCL file contains the changes made after the snapshot, so first the DCD is loaded and then the DCL entries are applied. As you perform operations on the table, entries are appended to the DCL. When the DCL grows large enough, Mnesia makes a new full DCD dump and empties the DCL.
Since all data is in RAM at runtime, things like full table searches are very fast, but you can end up needing a whole lot of RAM, and the startup times can get quite long.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With