dbTalk Databases Forums  

Secondary database to index two primary databases?

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Secondary database to index two primary databases? in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Leif K-Brooks
 
Posts: n/a

Default Secondary database to index two primary databases? - 04-09-2006 , 11:51 AM






Is it possible to create a secondary database which indexes the contents
of two different primary databases? It would be used for queries similar
to UNION in SQL.

Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Secondary database to index two primary databases? - 04-09-2006 , 09:26 PM






Hi Leif,

No, that isn't possible. Berkeley DB expects every entry in a
secondary index to exist in the primary. Only primary keys are stored
in a secondary, not a (database, primary key) pair.

You could get a similar effect by having a secondary index associated
with each of the primaries, but you'll need to walk two cursors over
the secondaries and merge the results. If you only need equality
joins, Berkeley DB can create a single cursor that walks multiple
secondaries in this way via the DB->join method.

Regards,
Michael.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.