[elephant-devel] Re: Derived Indicies

Ian Eslick eslick at media.mit.edu
Thu May 8 11:11:48 UTC 2008


On May 7, 2008, at 4:20 PM, Alex Mizrahi wrote:

> IE> Given that in Elephant, the cost of a btree instance is  
> negligable,
>
> it postmodern backend each btree is backed by a database table,
> so i think it's not that negligable there..

Ah, I think the CL-SQL and BDB have different performance implications  
then.  What is the purpose of doing it this way?  Are you specializing  
the table on the type of the keys in some way?

> IE> one way to do this is the just have a set of messages for each  
> user in
> IE> a user slot (a pset or set-valued slot).
>
> but i think it's quite easy to make cheap psets -- just a dup-btree  
> of pset-oid->item

That's nice; that was the intention of the default pset implementation.

> IE> messages.  Of course to get the full efficiency you want, we'd  
> have to
> IE> make a sorted-pset that sorts on some fn of the elements.
>
> sorted-pset? how can we sort something in database without having a  
> key?

BDB can sort on values as well.  The pset abstraction is currently  
guaranteed to be an unordered collection or unique objects.

> i think that would be more like indexed-pset, with indices being  
> btrees.
>
> as an interface, it could look like:
>  (get-by-range (messages-of user) 'date yesterday nil)
>
> but, damn, it would be much harder to make cheap btrees with SQL..

You could just do this directly using an indexed-btree if you really  
needed to.

Probably better to work on a native-lisp solution than to try to  
contort SQL to do this!

> IE> I'd like to think about different metaphors for solving these  
> problems
> IE> so we don't end up turning Elephant's interface into a less  
> efficient
> IE> variation of an ORM!
>
> i thought elephant is a BDB wrapper :)

It was, once.  It's slowly evolving into an OODB, but people are so  
used to SQL and ORM that I sense a strong leaning towards making the  
data representation and query access look like those you find in ORM  
systems.  Especially since many users are using postmodern, and the  
effective way to make the Elephant model faster on top of Postmodern  
is to change the abstractions to look more like tables and SQL.

Ian





More information about the elephant-devel mailing list