[erlang-questions] limit on ets:select/3

Ulf Wiger <>
Tue Apr 6 19:51:55 CEST 2010


Henning Diedrich wrote:
> I tried a couple of searches for a bit, looks like No to me.
> 
> Just for curiosity, what is the use of the limit you tried?

No use, in fact. I called a function to pull records out of
a table (sorted on timestamp) that would fit inside a frequency
window. The first time called, LastTime was 0, and now() was
a timestamp in microseconds. The assumption was that the two
timestamps would otherwise be pretty close, but I figured it
wasn't worth plugging the hole, since LastTime = 0 would
imply that the table was empty anyway.

It didn't occur to me that select(EmptyTab, Pat, BigNum)
would crash.

Like I said, I stumbled upon it by chance. :)

BR,
Ulf W


> Henning
> 
> Ulf Wiger wrote:
>>
>> By chance, I stumbled upon this particular limitation in ets:select/3:
>>
>> ** exception exit: badarg
>>      in function  ets:select/3
>>         called as ets:select(16400,[{{'$1'},[],['$1']}],628091364)
>>
>> It seems as if the upper bound for the select limit is 134217727,
>> that is, no bignums accepted.
>>
>> It's not a practical problem in my case, and I can feel that it's
>> justified, but is it documented anywhere?
>>
>> BR,
>> Ulf W
> 
> 


-- 
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
http://www.erlang-solutions.com
---------------------------------------------------

---------------------------------------------------

WE'VE CHANGED NAMES!

Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.

www.erlang-solutions.com



More information about the erlang-questions mailing list