Mnesia and uniqueness on two keys

Sean Hinde sean.hinde@REDACTED
Wed Jul 13 01:38:00 CEST 2005


Nowhere does the documentation claim that an index is part of a key.

Sean

On 12 Jul 2005, at 16:53, Joel Reymont wrote:

> I have a record defined like this:
>
> -record(tick_data, {
>       symbol,
>       date,
>       ticks % tuple
>      }).
>
> I create the table like this:
>
> mnesia:create_table(tick_data,
>                  [
>                   {disc_copies, Nodes},
>                   {index, [date]},
>                   {type, set},
>                   {attributes, record_info(fields, tick_data)}
>                  ])
>
> My intent is to have a table where multiple records with the same 
> symbol but different dates can coexist. Will the above work or do I 
> need to create a bag table?
>
> In other words, does Mnesia expect uniqueness on each keys or do both 
> keys work as a composite?
>
>     Thanks, Joel
>
> --
> http://wagerlabs.com/uptick
>
>
>




More information about the erlang-questions mailing list