[erlang-questions] mnesia:dirty_select/3 feature request

Serge Aleynikov <>
Thu Jun 5 13:22:57 CEST 2008


Thanks for the tip.  In my search through mnesia documentation for 
"dirty_*" functions I indeed missed the "*_dirty" pattern!  Though 
having mnesia:dirty_select/3 would be quite logical as it would be 
symmetric to it's transaction-based mnesia:select/3 counterpart.


Paul Mineiro wrote:
> Serge,
> Via mnesia:activity/4, you can pretty much do any sequence of mnesia
> operations as dirty as you want. However the enclosing context can
> increase the transaction semantics associated with an operation, e.g., if
> you make a call to mnesia:async_dirty/1 within a call to
> mnesia:sync_transaction/1, the operation will not be dirty.
> In contrast, the dirty_* functions are *always* dirty, and do not inherit
> transaction semantics from the enclosing context.  So while an
> mnesia:dirty_select/3 would be different in this regard than
> mnesia:async_dirty (fun ()  -> mnesia:select (...) end), maybe the latter
> is good enough for you?
> Cheers,
> -- p
> On Wed, 4 Jun 2008, Serge Aleynikov wrote:
>> Currently there are mnesia:dirty_select/2 and mnesia:select/{3,4}
>> functions, but no mnesia:dirty_select/3 with the following signature:
>> mnesia:dirty_select(Table, MatchSpec, Limit) ->
>> 	{Records, Continuation}
>> I believe it would be very useful to have this function for cases when a
>> user needs to get only a few matching records out of a very large table.
>> Or perhaps am I missing some other ways to do mnesia selects using fast
>> read matching operations with a Limit clause that don't involve
>> transactions?
>> Serge
>> _______________________________________________
>> erlang-questions mailing list
>> http://www.erlang.org/mailman/listinfo/erlang-questions
> In an artificial world, only extremists live naturally.
>         -- Paul Graham
> _______________________________________________
> erlang-questions mailing list
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list