Spatial indexing in mnesia

Shawn Pearce spearce@REDACTED
Thu Jan 4 00:44:40 CET 2001

Has anyone ever considered storing spatial data in mnesia?  It requires
creating a different style of indexing than dets must use for lookup of

Oracle implements their spatial indexes as an auxiliary table that
stores each node of the spatial index tree as a row in the table.  This
table is then indexed using traditional b*-tree indexes for performance.

We'd like to stay with mnesia, but we're running into the trouble of
overloading mnesia's log writer, and being faced with the need to do
spatial data.

I'm afraid performance will suck if we have to implement a spatial index
as a standard dets table, as we'd be doing 20 or 30 read calls to mnesia
just to do the lookup in the spatial index, then turn around and perform
another read call to load the actual record we wanted.  Doing this for
a few hundred lookups at a time will choke mnesia as far as reading
goes, right?

Is this like ``far out there research'' type stuff to be doing with such
a high-level language as Erlang?  Mnesia is great, but it strikes me
that its performance is limited by the language's own constraints of
lists and tuples, none of which can be fixed-length or blocked together
like one can do in C.


  ``If this had been a real
    life, you would have
    received instructions
    on where to go and what
    to do.''

More information about the erlang-questions mailing list