Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 66119 invoked from network); 16 Oct 2006 13:59:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Oct 2006 13:59:06 -0000 Received: (qmail 95718 invoked by uid 500); 16 Oct 2006 13:59:04 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 95695 invoked by uid 500); 16 Oct 2006 13:59:04 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 95683 invoked by uid 99); 16 Oct 2006 13:59:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2006 06:59:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [65.195.181.55] (HELO dbrack01.segel.com) (65.195.181.55) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2006 06:59:00 -0700 Received: from Desktop02 (desktop02.segel.com [65.195.181.45]) by dbrack01.segel.com (Postfix - We shoot spammers on site.) with ESMTP id 1DFC64BA8D for ; Mon, 16 Oct 2006 09:06:03 -0500 (CDT) Reply-To: From: "Michael Segel" To: "'Derby Discussion'" Subject: RE: Is it Possible to Turn off Referential Constraints for a DBUNIT Load? Date: Mon, 16 Oct 2006 08:58:38 -0500 Organization: MSCC MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 In-Reply-To: thread-index: AcbxGZc1N5dV7/caRCS4YWUq1GuGEAAEI1Bg Message-Id: <20061016140603.1DFC64BA8D@dbrack01.segel.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Dan Scott [mailto:denials@gmail.com] > Sent: Monday, October 16, 2006 6:45 AM > To: Derby Discussion > Cc: msegel@segel.com > Subject: Re: Is it Possible to Turn off Referential Constraints for a > DBUNIT Load? > [SNIP] > And to be fair, DB2 and Oracle offer the same sort of functionality > via the SET CONSTRAINTS statement. In Oracle's case, the constraints > are checked at the end of the transaction -- so if you load a million > rows, you're not checking row-by-row. > [mjs] Using Oracle as the example, the constraint checking occurs at the end of the process. The key point is that the constraint checking occurs. > The reason people typically want to temporarily disable constraints > for a load is to increase the speed with which you can load data. It > certainly makes a big difference if you're loading a data warehouse > with a terabyte of data; that's probably not a space where Derby is > going to come into play, but a common enough need for other databases. > [mjs] Yup. Constraint checking certainly slows things down. But even Oracle recognizes that you can't stop the checking, especially in a terabyte DW. With respect to Derby, you're using constraints for a reason. Most likely you're using it in conjunction with a data dependent application. What do you think happens if you have bad data? Can you say core dump? Or in terms of Java... an unexpected exception is going to be thrown.... With respect to Chris, He's looking for a "feature" that will allow him to use a tool to load data and make his life easier. With respect to XML, the self referencing nature of XML makes life a little more difficult. If you can load a record at time, you should be able to put it in to a tree and then choose the load orders. In terms of a data warehouse, you'd load the fact tables first, then the parent record and then its children. Perhaps the key isn't in turning off constraints, but building a better tool? > Dan