[erlang-questions] More Mnesia Questions

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Fri May 9 12:24:17 CEST 2008


Bill Robertson skrev:

> 2. I want to track the selection frequency of terms, and then
> frequently retrieve the N most popular terms. In a relational
 > database, I would just create an index in descending order and use
 > an appropriate order by clause. I don't see any options to do that
 > with an mnesia index though. Would qlc be smart enough to figure it
 > out walk the index backwards? How would you even do that in qlc?

If you want to jump in at the (very) deep end, the rdbms contrib
has support for ordered indexes, as well as first/next/prev
operations via index.

http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/rdbms/

Unfortunately, it's not been updated for the last 2 years,
so it would not work in R12B. If you want to hack your own indexing
support, you might get inspired (or put off) by peeking at e.g.
rdbms_index.erl. Most of it should work without having to patch
mnesia... (:


BR,
Ulf W



More information about the erlang-questions mailing list