directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu" <aok...@bellsouth.net>
Subject RE: [bdbje] [rms] Using rowid in secondary databases
Date Fri, 16 Apr 2004 04:51:24 GMT
Thanks a bunch Linda - I'm looking it over now.

	--Alex

> -----Original Message-----
> From: Linda Lee [mailto:linda@sleepycat.com]
> Sent: Thursday, April 15, 2004 10:24 PM
> To: Alex Karasulu
> Cc: bdbje@sleepycat.com
> Subject: Re: [bdbje] [rms] Using rowid in secondary databases
> 
> 
> 
> Alex Karasulu wrote:
> 
> >I'm envisioning the use of sequences to do this in a structure like
> >so:
> >
> >http://nagoya.apache.org/jira/secure/attachment/14385/DatabaseTable.png
> >
> >Now I'm sure the folks at SleepyCat thought about this one before.
> >Wondering what your findings were if the use of integers and sequences
> >was thought of to tie together secondary and master databases.
> >
> >
> I believe that this can be done easily using our secondary databases as
> indices. To illustrate this, I modified SecondaryExample.java ( included
> in the JE distribution) to use the data you sketched out. (Though I
> changed key2 values to 10 and 20 for clarity).  I used an integer to act
> as a tuple id, so that the main database consists of:
> 
> key = rowid
> data = {key1, key2, col3, col4}
> 
> and then added secondaries that were keyed on key1 and key2. Then I show
> how to fetch from the main database, by key1, by key2,  and how to do a
> join on key2 and key2.
> 
> There is one issue, which is that I generated the rowid, instead of
> having a sequence. We've been talking about sequence support at
> Sleepycat, but that's not a feature in JE yet, so you'd have to generate
> the rowid in the application.
> 
> >
> >Also on a side note I was wondering if the feature that resuscitates
> >the primary database entry when a lookup occurs on a secondary can be
> >turned off in any way.  Sometimes an application may just want to
> >scan indices and that suffices so resuscitating the data within the
> >master table is wasteful in these situations.  Is there a mechanism
> >for controlling this aspect of JE?
> >
> >
> Hmm, I believe you're right. We're always returning a SecondaryCursor
> when we get a cursor on a secondary database, and that class always
> fetches data from the primary database. I'll check with some other folks
> who are more familiar with secondaries though.
> 
> Linda Lee
> Sleepycat Software




Mime
View raw message