Suggestion: New table iterators

Ulf Wiger etxuwig@REDACTED
Thu Oct 19 14:16:09 CEST 2000


On Thu, 19 Oct 2000, Hakan Mattsson wrote:

>On Thu, 19 Oct 2000, Sean Hinde wrote:
>
>Sean> I'd like to add my support for iterators over ets/dets/mnesia.
>
>Yes, at least they looks cute. But in order to enable a real efficient
>implementation of them, the not yet released select functionality in
>ets and dets is needed. Then it would be possible to efficiently
>perform parts of the filtering, locally, near the data source,
>avoiding lots of copying. 

Yes, I've toyed with ets:select/2 - it's pretty powerful, but the
syntax leaves a little something to be desired (looks like Lisp's
ugly cousin.) The same goes for the trace functionality: my first
impression is that it's great, but much too difficult to specify the
trace filters, since they're not expressed in "standard Erlang".

The documentation is worse though (may have something to do with the
fact that it's not yet released... (: ). You have to read the docs
on trace filters and/or the code in erl_db*.c, and/or use trial and
error.

If anyone wants to peek at it, ets:select(Tab, Pattern) is the 
function to use. Especially in combination with ordered sets, you can
perform really fast queries with reasonably complex select logic.
I understand fully that it's not ready, not released, not supported,
and all that, but hey - that's where the fun lies, right?

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Strategic Product & System Management        mob: +46 70 519 81 95
Ericsson Telecom AB,              Datacom Networks and IP Services
Varuvägen 9, Älvsjö,                    S-126 25 Stockholm, Sweden




More information about the erlang-questions mailing list