Mnesia question

Christian S <>
Wed Jun 7 10:07:33 CEST 2006


My conclusion is that this is just a case of more-than-one-way-to-do-it.

By the way, indexing would be a lot more useful if one could use them
to speed up queries on multiple keys. Ex. for a database storing forum
threads:
{thread, Site, Forum, ThreadId}

And you want to find ThreadIds for Site="erlang.org", Forum="mnesia".

Today one has to create a key or indexed field that stores {Site, Forum}
in a tuple. This makes the records a bit uglier.

All in all though, this is just a wart. Not a showstopper.

On 6/5/06, Yariv Sadan <> wrote:
> Hi,
>
> I have a newbie question about one-to-many relations in Mnesia: In the
> Getting Started section of the Mnesia User's guide, the one-to-many
> relation between "employee" and "dept" is given its own table,
> "at-dep". Why is this relation expressed in a new table? Wouldn't it
> be better to add a "dep_id" field to the "employee" table, with an
> index on this field?
>
> Thanks,
> Yariv
>



More information about the erlang-questions mailing list