There are three reasons: performance, criticity for info consistency and how likely it is to break the constraint.
It is very expensive in system resources to maintain double referential integrity from all tables to the ad_user table. And the criticity of breaking this constraint is low (records with audit info that points to users that don't exist) and unlikely (audit info is automatically managed). Comparing with the foreign key constraints for ad_client and ad_org: -The impact in performance is much higher because the volume of info and transactionality (number of changes) is much bigger in ad_user than in ad_client/ad_org. -Criticity of info is much lower in audit info that in ad_client/ad_org (a record assigned to a non-existing client is a big issue). -Since audit info is system managed it is not likely to break the constraint (ad_client/ad_org info are user managed). As a rule of thumb, all integrity constraints should be enforced at database level. But just this one has been removed to avoid a performance problem. Regards, Ismael -----Mensaje original----- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nombre de Galder Romo Enviado el: miercoles, 27 de febrero de 2008 11:26 Para: [email protected] Asunto: [Openbravo-development] constraints ad_user&createdby andad_user&updatedby Hello everybody: Does anybody know why Openbravo tables have foreign key constraints applying for ad_client_id and ad_org_id but haven't constraints for createdby and updatedby fields? Thanks, Galder ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Openbravo-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-development -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.21.1/1300 - Release Date: 26/02/2008 19:50 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Openbravo-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-development
