[erlang-questions] match_object and index_match_object

Alexander Lamb alexander.lamb@REDACTED
Tue Mar 25 09:39:47 CET 2008


Hello List,

If I have a mnesia table defined as a set, as I understand, the first  
column will by default be used as a unique index.

Then, why do I get this when I look at the table info:

...
{attributes, [full_profile,features]},
...
{index, []},
...
{type,set},
...

So I tried to add an index on that first column, but I got errors,  
presumably because as a set, that column was already included as an  
index.

Related to this, I tried two different ways to retrieve data from the  
table:

match_object and index_match_object

If I match on a pattern of the unique index of the set, will both  
functions behave the same in terms of speed?

Finally, I am using a set with only two columns. The index column is a  
tuple which can have the form:

{{Context, SubContext}, ProductionType, Profile}

I need this rather complex index column because it has to be unique.

Then, I match_object(profiles, 
{profiles,aContext,aProductionType,'_'},'–'}

What is the efficiency of a partial match on an index column?

Thanks for any help!
--
Alexander Lamb
Founding Associate
RODANOTECH Sàrl

4 ch. de la Tour de Champel
1206 Geneva
Switzerland

Tel:  022 347 77 37
Fax: 022 347 77 38

http://www.rodanotech.ch






More information about the erlang-questions mailing list