[erlang-questions] Reading An Mnesia Index (Not The Records It Points To)

Gordon Guthrie gordon@REDACTED
Mon May 4 15:44:54 CEST 2009


In case your a visitor from the future arriving here courtesy of Google:
* the answer is mnesia:all_keys/1
* the lesson is RT the F'in M a bit better :(

Gordon

On Fri, May 1, 2009 at 1:37 AM, Jacob Perkins <japerk@REDACTED> wrote:
> It'd probably be easier to manage the index yourself as a separate table.
> Maybe an ordered_set table where the record is something like {key={indice,
> record_id}, val=val}. Then you can match on the indice to pull out
> record_ids and vals.
>
> Jacob
>
>> I have an index on a table that represents a user taxonomy - how the
>> user has chosen to organise their world in the application.
>>
>> It is a fairly dense index, that is for each indice there will be
>> between 30 and several hundred actual records.
>>
>> At the moment to expose the taxonomy to the user I have to build a
>> query that returns the value of the index from every record, and then
>> de-duplicate that back down to get the index - which has been slow on
>> occasions...
>>
>> As far as I can tell there is no way through the published API to
>> simply 'read the index' but I am sure I could plow into the code and
>> 'work it out' but I am wary of the old 'undocumented API' beartrap.
>>
>> Any suggestions?
>>
>> Gordon
>



More information about the erlang-questions mailing list