On 14/03/13 14:25 +0100, Wolfgang Keller wrote: > > What is your use case ? I'm genuinely interested as I'm advocating > > composite key support myself :) > > If you're advocating it then you probably won't need to know any further > arguments since you've already understood the issue yourself: That data > integrity is what counts. And without composite keys, that can't work > for any non-trivial application that requires a thoroughly normalised > schema of significant complexity, since proper unification of records > in such a schema requires composite keys. One of the issues that's > practically impossible to solve with surrogate keys is explained in > database design textbooks under the title "overlapping foreign keys".
I'm not sure to understand exactly the "overlapping foreign keys" (as you did not give any reference). But I guess it is about when you update a tuple that is a foreign key in an other table where there are some constraints on it. Like, you would like to use a foreign composite key of (product type, product id) on stock move with a constraint of "product type" != service. This is attracting but the main issue is such design makes the modularity much more complicate if not impossible. Also it only solves simple cases, in Tryton we have much more complexe domain on the Many2One that are checked by the Python code but of course it is only when the source is modified not the target. But in case of important constraint, you can still add a check in the code on the target like we did in stock module to prevent change the uom of a product if stock move already exists. > In my case, I'm specifically using an industry standard data model that > has been in continuous development (by a non-profit organisation, > in cooperation between domain expoerts and database design experts) > and use for over a decade now. It's currently at >400 entities and > growing. For the length of the primary keys, I stopped counting at 15 > columns or so. It will be useful to provide links. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpWFAj2YmZZY.pgp
Description: PGP signature
