[erlang-questions] mnesia queries

Bernard Duggan bernie@REDACTED
Sun May 9 03:06:54 CEST 2010


Basically the answer is 'no', there isn't a much better way to do it
than to drop an re: operation in the query ('re' is the new 'regex'),
and yes this will be "slow" (for some definition of "slow").  The thing
to remember is that mnesia isn't an SQL database, nor is it trying to
be.  Like every db system, it's built of compromises to be really good
at some stuff (for example really fast lookup of key-value style data,
distribution of that data across nodes so that you can do that read work
on any node without needing any network traffic, storing arbitrary
erlang terms rather than fixed-type data etc) at the expense of not
being particularly good at other stuff.  If you want it to be an SQL
database, you're going to be disappointed - it isn't one.  If, however,
what you need is what mnesia provides then it's totally brilliant and
leaves SQL systems looking fairly silly :)

Cheers,

Bernard


On 9/05/2010 3:59 AM, Marcel Meyer wrote:
> Wes,
> I'm still digging into Erlang as well, but I would guess your predicate
> function will have to do a regex on the value.
> I hope the pros can suggest something better, as I read that Erlang's Regex
> lib is awfully slow.
>
> Regards,
> Marcel
>
> On 8 May 2010 10:54, Wes James <comptekki@REDACTED> wrote:
>
>   
>> I have been looking at mnesia and can do some simple quieries.  Are
>> there queries like in sql where you have: where field like '%data' -
>> that is a "like" with the "%" operator?
>>
>> thx,
>>
>> -wes
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>>
>>     



More information about the erlang-questions mailing list