[erlang-questions] mnesia question - fastest way to tell if ordered_set table is empty or not
Sun Jun 16 23:25:38 CEST 2013
Have you tried this?
On 16 June 2013 20:14, Jonathan Leivent <> wrote:
> What is the fastest way, avoiding locking, to tell if an ordered_set
> mnesia table is empty or not? I'm assuming that if the table is not an
> ordered set, then:
> mnesia:activity(ets, fun mnesia:first/1, [Table]) == '$end_of_table'
> is the fastest. However, if the table is an ordered set, this seems like
> it could take O(logN) time.
> Would this be faster?:
> mnesia:activity(ets, fun mnesia:table_info/2, [Table, size]) == 0
> Is there a faster alternative?
> -- Jonathan
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions