Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 161 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 475 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Multiple secondary keys per primary db record

527197
Member Posts: 27
Hello,
The current version of BerkeleyDB supports the generation of one secondary key per primary db record. There are cases when multiple secondary keys per primary db record would be nice.
In my current application each record may belong to one or more types which are stored as a list of numbers within the data-field. With the given limitation I can only index one of these types, because the key-generation-function only allows to return one secondary key.
Are there any plans to add such a feature, e.g. return a list of secondary keys?
As a workaround I have tried to build my own secondary database meachanism- now I appreciate your efforts even more :-). Is there any public material on the way berkeley db keeps the secondary db synchronized? If a new record is inserted the situation is pretty simple- just compute the secondary key and insert it. But what if because of an update an indexed feature is removed from the indexed record? I imagine the lookups are pretty expensive- or the efforts to make it in a convenient time make it very complex...?
This issue is pretty much important for my project. Are there any hints you could give me?
Best regards,
Rüdiger
The current version of BerkeleyDB supports the generation of one secondary key per primary db record. There are cases when multiple secondary keys per primary db record would be nice.
In my current application each record may belong to one or more types which are stored as a list of numbers within the data-field. With the given limitation I can only index one of these types, because the key-generation-function only allows to return one secondary key.
Are there any plans to add such a feature, e.g. return a list of secondary keys?
As a workaround I have tried to build my own secondary database meachanism- now I appreciate your efforts even more :-). Is there any public material on the way berkeley db keeps the secondary db synchronized? If a new record is inserted the situation is pretty simple- just compute the secondary key and insert it. But what if because of an update an indexed feature is removed from the indexed record? I imagine the lookups are pretty expensive- or the efforts to make it in a convenient time make it very complex...?
This issue is pretty much important for my project. Are there any hints you could give me?
Best regards,
Rüdiger
Comments
-
The current version of BerkeleyDB supports theYes, we agree.
generation of one secondary key per primary db
record. There are cases when multiple secondary keys
per primary db record would be nice.Are there any plans to add such a feature, e.g.Yes. Unfortunately, this feature has been on our todo list for a few years, we just haven't managed to get the work done.
return a list of secondary keys?As a workaround I have tried to build my ownThere's no design documentation of which I'm aware. The code is almost entirely in the distribution file db/db_cam.c, if you're willing to modify the Berkeley DB secondary support directly.
secondary database mechanism- now I appreciate your
efforts even more :-). Is there any public material
on the way berkeley db keeps the secondary db
synchronized?This issue is pretty much important for my project.If you're coding in Java, you might want to look at the Berkeley DB Collections API, or the Berkeley DB Java Edition product -- both of them support many-to-many indices already.
Are there any hints you could give me?
Keith Bostic
[email protected] -
Thank you for the advice! Iam using the db_cxx (just moved away from Java ;-). I will check the source file you mentioned and post again if I find a convenient extension fit for others.
Best regards,
Ruediger
This discussion has been closed.