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

Paul Mineiro paul-trapexit@REDACTED
Thu Jun 5 08:19:13 CEST 2008


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
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>

In an artificial world, only extremists live naturally.

        -- Paul Graham



More information about the erlang-questions mailing list