Ordered indices in Mnesia

chandru chandrashekhar.mullaparthi@REDACTED
Wed Dec 14 06:59:11 CET 2005


Hi,

On 14/12/05, Dave Smith <dizzyd@REDACTED> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> This may be a stupid question, but I just can't seem to find the
> answer. Is it possible to create a ordered index in mnesia? For
> instance, I want to do the SQL equivalent of:
>
> SELECT TOP 10 value FROM table

Mnesia has ordered set tables. When you create your table, you have to
specify the {type, ordered_set} option. This only applies to the
primary index. You can then use select to retrieve the top 10 records

cheers
Chandru



More information about the erlang-questions mailing list