[erlang-questions] mnesia:transform_table
Igor Ribeiro Sucupira
igorrs@REDACTED
Wed May 26 17:48:21 CEST 2010
I thought of using a dict or a gb_trees to store the fields of each
entry, but I gave up in seconds (;-)), because the only advantage
(compared to proplists) would be the speed to retrieve a field (what
is very fast, anyway), once you have read the record from the database
(which is the slowest part).
Considering that the performance difference to find a field is not
significant if the number of fields is not big, using a gb_trees would
be just a waste of space, for the huge majority of the cases.
On Wed, May 26, 2010 at 12:08 PM, Chris Hicks
<silent_vendetta@REDACTED> wrote:
>
> Yes I am still modeling tables and I remembered reading your blog, I'm just making sure I understand all of my options beforehand. I'm trying to decide between using a list with key-value pairs, a dict and a proplist. Are there any major disadvantages to using one of those over the other?
>
>> From: igorrs@REDACTED
>> Date: Wed, 26 May 2010 03:52:23 -0300
>> To: silent_vendetta@REDACTED
>> CC: erlang-questions@REDACTED
>> Subject: Re: [erlang-questions] mnesia:transform_table
>>
>> If you are still modelling the tables, you might also want to consider
>> some approach to avoid running mnesia:transform_table/3, since it
>> needs to rewrite all the records.
>>
>> For example, as described here:
>> http://igorrs.blogspot.com/2010/05/mnesia-one-year-later-part-2.html#key_value
>>
>> And discussed in this thread (from the third post on):
>> http://forum.trapexit.org/viewtopic.php?p=55510&sid=cc3aec96ba9387b61b5d192ccd1de1a6
>>
>> Good luck.
>> Igor.
>>
>> On Wed, May 26, 2010 at 2:09 AM, Chris Hicks
>> <silent_vendetta@REDACTED> wrote:
>> >
>> > So when updating a record definition the updated record, when reloaded, is not compatible with the old version of the record, as far as I understand it. Updating a Mnesia table to handle the new definition is straightforward enough but, my question revolves around the rest of the running system. Mainly I want to know what is the general (if there is one) process to updating a running system in this manner?
>> > Should you create a function which locks the whole table, reloads the code and updated all the definitions at the same time? What happens to the rest of the running system when you update a record definition while a process is in the middle of working with that old record?
>> > _________________________________________________________________
>> > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.
>> > http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
>>
>>
>>
>> --
>> "The secret of joy in work is contained in one word - excellence. To
>> know how to do something well is to enjoy it." - Pearl S. Buck.
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>
> _________________________________________________________________
> Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
--
"The secret of joy in work is contained in one word - excellence. To
know how to do something well is to enjoy it." - Pearl S. Buck.
More information about the erlang-questions
mailing list