How do I create and use (or simulate) multi-column indexes in Erlang Mnesia?

One way is to store {X, Y} directly in the "column" that has the key. This makes you able to search fast on queries of structure {_, _} but it also means slower searches when you only know one of the values in the tuple (By default, the tables are hash-tables).

Mnesia has event based notifications. Its possible to have a process (gen_server) which subscribes to mnesia events. These events are categorised: Table events, System events and others.

Read the mnesia documentation at the part concerning events. Its actually possible for a process to report events using mnesia event handler by calling: mnesia:report_event(Event). All process subscribed to mnesia events will get this message.

Mnesia will report real-time information about all transactions on a table to subscribed processes. There can be read, write or delete transactions and a process in its loop can pattern match the type of event it may be interested in. There are detailed and simple table events.

I have personally found the events very useful. You should be able to get the details from the documentation.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions