[erlang-questions] Get a range of tuples from a Mnesia table

Mats Cronqvist mats.cronqvist@REDACTED
Tue Oct 7 10:28:19 CEST 2008


Edwin Fine wrote:
> Looking through the docs, I see that if you are using an mnesia table 
> that is ram_copies or disc_copies, you can do certain fast operations 
> on the associated ets table. One such operation (which is recommended 
> only for debugging, but what the heck) is ets:slot(Tab, I), which 
> returns the I'th record in the table.

  slot/2 does not in general return the I:th record.
  it does return a one-element list of the I:th record, iff the table is 
of type ordered_set. for other table types, it returns a list of all 
records in the I:th slot, i.e. all objects whose keys hash to the same 
value.

  mats



More information about the erlang-questions mailing list