Re: [elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Ian Eslick
IE> As for Sean's request about doing an efficient intersection, as Alex IE> was explaining there are only two ways to do this efficiently: no, these are two ways to do it inefficiently, there is only one way to do it efficiently -- via combined index :) True, but his request was efficienc

[elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Alex Mizrahi
IE> The string tuple-sorting hack makes me cringe. yep, this looks weird. but i mostly have id-and-time situation, and it works fine for it. IE> I know that I could make BDB and the lisp side sort lists based on IE> their constituents pretty easily if you felt we could make the same IE> ha

Re: [elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Sean Ross
On 4/4/08, Ian Eslick <[EMAIL PROTECTED]> wrote: > However, premature optimization often causes more trouble than it's worth. > The easiest thing to do to get going is to index both slots and say: > > (intersection (get-instances-by-range 'event 'date ) > (get-instances-by-value 'e

Re: [elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Ian Eslick
Hi there, The string tuple-sorting hack makes me cringe. I know that I could make BDB and the lisp side sort lists based on their constituents pretty easily if you felt we could make the same hack work in postmodern. (cons "Fred" 23) < (cons "Fred" 25) < (cons "Sally" 10) Maybe we could

[elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Alex Mizrahi
SR> What is the best/easiest/most-elephantish way to retrieve all events SR> in the btree which have the 'lisp' tag and whose date falls on today? so you have lots of possible tags and many tags per event? then you need a btree with entry for each event for each tags, that is ( -> event_id) btr

[elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Alex Mizrahi
??>> i believe that SQL RDBMS work this way too -- if one needs fast ??>> retrieval by several keys, he should create index on them. RDMBS knows ??>> how to sort tuples, though SR> Well yes, but generally SQL RDBMS's will make efficient use of indexes SR> it they are created on all the keys

Re: [elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Sean Ross
> I'm really just curious about using > 2 btree indices together without requiring the creation of a 3rd. Of course I could be working against elephant while trying to do all of this. So here is what I am trying to achieve, any pointers would be great. Given the following code. >> (defpackage

Re: [elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Sean Ross
On 4/4/08, Alex Mizrahi <[EMAIL PROTECTED]> wrote: > (defclass test-event () > ((date :accessor date-of :initform (now) :index t) ... > and it will create indices for you automatically. Yes, although this is just an example of what I'm trying to achieve and isn't exactly what i'm doing. I'm re

[elephant-devel] Re: traversing btree using multiple indices

2008-04-04 Thread Alex Mizrahi
SR> (defclass test-event () SR> ((date :accessor date-of :initform (now)) SR>(name :accessor name-of :initform nil)) SR> (:metaclass persistent-metaclass)) SR> (defun create-date-indexer (a b c) (values t (date-of c))) SR> (defun create-name-indexer (a b c) (values t (name-of c)))

[elephant-devel] Re: traversing btree using multiple indices

2008-04-03 Thread Alex Mizrahi
SR> I'm hoping that someone can point me in the right direction here. SR> Given 2 secondary indices on an indexed btree is it at all possible to SR> create/use a derived index which is the union of the 2 created indices SR> without requiring the explicit creation of a 3rd index i'm not sure