thx
________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questio...@erlang.org
No, not if the purpose is to gain performance.
Otherwise you can use mnesia:select/2 or qlc.
/Håkan
Agreed. I would go with qlc, in this case, as the list comprehension
used makes it make more sense in my mind.
E.g. of qlc with some search constraints.
> {MegaSecs, Secs, _MicroSecs} = now().
> SecondsAtNow = MegaSecs * 1000000 + Secs.
> Q = qlc:q([{X.id, X.other_column} || X <- mnesia:table(x), (SecondsAtNow - X#x.timestamp) > 60]).
> F = fun() -> qlc:e(Q) end.
> {atomic, List} = mnesia:transaction(F),
List now contains tuples of X.id and X.other_column, where X.timestamp
is older than a minute.
__armando