
Comments: Again, congratulations on this library. I see it, combined with the serialization library , as having the potential to eliminate the need for relational databases in c++ applications. Granted, if the development staff consists of DBAs and Java developers they would not agree to such a thing. However, if you have an application that consists of just c++ code, you could make the argument that relational databases are no longer needed. That would be a great thing, as relational datbases and sql are not c++ friendly. I spent many years writing c++ applications that were simply wrappers over relational datbases designed by DBAs. I've always thought that there had to be a better way. It would appear that you have done just that with this library. Questions: 1) When you add a record to an indexed_set, and it violates the index definition in some way, could you throw an exception, instead of simply replacing the original record? 2) Is there support for mult-key unique indicies. I read in the documenation that you can have more than one unique indice in the definition, but they are unique individually. Question: Can you combine two or more of those unique indice to create a multi-key unique indice. __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html

Most SQL database servers store the indices as B-trees and use sophisticated caching techniques such that they are not limited to a database that fits entirely within main memory. (In fact, it is quite common for such databases to significantly exceed the amount of main memory available.) -- Jeremy Maitin-Shepard

----- Original Message ----- From: "Tom Brinkman" <reportbase@yahoo.com> To: <boost@lists.boost.org> Sent: Monday, March 29, 2004 6:25 AM Subject: [boost] Index_set observations
Comments: Again, congratulations on this library. I see it, combined with the serialization library , as having the potential to eliminate the need for relational databases in c++ applications.
What's wrong with relational databases?
Granted, if the development staff consists of DBAs and Java developers they would not agree to such a thing. However, if you have an application that consists of just c++ code, you could make the argument that relational databases are no longer needed. That would be a great thing, as relational datbases and sql are not c++ friendly.
Here I agree. I hope that designs like indexed_set<> and RTL will lower the impedance mismatch, too.
I spent many years writing c++ applications that were simply wrappers over relational datbases designed by DBAs. I've always thought that there had to be a better way. It would appear that you have done just that with this library.
Questions: 1) When you add a record to an indexed_set, and it violates the index definition in some way, could you throw an exception, instead of simply replacing the original record?
As far as I understand, insert() returns a std::pair<iterator, bool>. The boolean indicates, if the insertion was successful. insert() doesn't replace an existing record.
2) Is there support for mult-key unique indicies. I read in the documenation that you can have more than one unique indice in the definition, but they are unique individually. Question: Can you combine two or more of those unique indice to create a multi-key unique indice.
If you create an indexed_set of thingies typedef is::indexed_set< thingy, is::index_list< is::unique<is::tag<pk_tag>, is::identity<const thingy>, pk_comparer>
thingies;
where pk_comparer implements an specialized comparer based on lex_compare, will do the job (see example/composite_compares.cpp for an example). Maybe this construction could be simplified. Best, Joerg

"Tom Brinkman" <reportbase@yahoo.com> wrote in message news:20040329042535.5205.qmail@web13907.mail.yahoo.com...
[...] I see it, combined with the serialization library , as having the potential to eliminate the need for relational databases in c++ applications.
I disagree entirely. I don't see that IndexedSet + Serialization can replace JOINs, referential integrity, and a host of other features that any standard RDB server provides. I especially don't see how it can match the fast file access you should expect and demand from an RDBMS. "Serialization" != "random access". That being said, I do think that IndexedSet is a very useful library, and my review of it will be forthcoming.
[...] 1) When you add a record to an indexed_set, and it violates the index definition in some way, could you throw an exception, instead of simply replacing the original record?
I agree that at least an option for this behavior is probably appropriate.
2) Is there support for mult-key unique indicies. I read in the documenation that you can have more than one unique indice in the definition, but they are unique individually. Question: Can you combine two or more of those unique indice to create a multi-key unique indice.
And this is where you begin to see the difference between IndexedSet and a full RDBMS. ;) I don't think such a functionality is necessarily appropriate at the IndexedSet level. I suspect that this kind of feature might be supported by the RTL (which acronym I really don't like, because it looks too much like "RunTime Library"), but those authors will have to speak for it. Then again, some kind of composite index might indeed be appropriate at the IndexedSet level. I haven't thought it all through. Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.581 / Virus Database: 368 - Release Date: 2/9/2004

"David B. Held" <dheld@codelogicconsulting.com> wrote
that this kind of feature might be supported by the RTL (which acronym I really don't like, because it looks too much like "RunTime Library"), but those authors will have to speak for it.
If this is the only thing you don't like about RTL, than we can negotiate the name :) Arkadiy

Hi Tom Tom Brinkman ha escrito:
Comments: Again, congratulations on this library. I see it, combined with the serialization library , as having the potential to eliminate the need for relational databases in c++ applications.
Well, IMHO this is a too far-fetched. RDBMS are sophisticated products with tons of capabilities that indexed_set is not even close to being able to emulate. OTOH, if your program needs to store a personal contacts book, then probably indexed_set would suffice. If you're into relational stuff, take a look at Arkadiy's RTL. I'm hopeful this library can provide an excellent replacement for "real" databases when dealing with moderate ammounts of data. Plus, he'll probably use indexed_set as the storage core :)
Questions: 1) When you add a record to an indexed_set, and it violates the index definition in some way, could you throw an exception, instead of simply replacing the original record?
If the insertion violates some constraint, then it does not take place. insert operations return a pair<iterator,bool>: the bool indicates whether insertion succeeded or not.
2) Is there support for mult-key unique indicies. I read in the documenation that you can have more than one unique indice in the definition, but they are unique individually. Question: Can you combine two or more of those unique indice to create a multi-key unique indice.
Take a look at lex_compare in example 7 for a method to combine two keys into a "composite" unique constraint. Most probably I'll lift this construct (along with compose_key in example 6) to the library itself. Regards, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

On Mon, Mar 29, 2004 at 08:14:09AM +0200, Joaqu?n M? L?pez Mu?oz wrote:
If the insertion violates some constraint, then it does not take place. insert operations return a pair<iterator,bool>: the bool indicates whether insertion succeeded or not.
Forgive me if this has already been asked, but why don't you return a boost::optional<> object? -- Shannon Stewman | Let us walk through the waning night, Caught in a whirlpool, | As dawn-rays tickle our toes, the dew soothes A quartering act: | Our blistered soles, and damp bones stir Solitude or society? | As crimson cracks under the blue-grey sky.

"Tom Brinkman" <reportbase@yahoo.com> wrote
2) Is there support for mult-key unique indicies. I read in the documenation that you can have more than one unique indice in the definition, but they are unique individually. Question: Can you combine two or more of those unique indice to create a multi-key unique indice.
You can use calculated index (wich uses result of function call). This way you can enforce any constraint one can think about. /Pavel
participants (8)
-
Arkadiy Vertleyb
-
David B. Held
-
Jeremy Maitin-Shepard
-
jhr.walter@t-online.de
-
Joaquín Mª López Muñoz
-
Pavel Vozenilek
-
Shannon Stewman
-
Tom Brinkman