Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 9688 invoked from network); 29 May 2009 17:00:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 May 2009 17:00:24 -0000 Received: (qmail 56747 invoked by uid 500); 29 May 2009 17:00:36 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 56679 invoked by uid 500); 29 May 2009 17:00:35 -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 56665 invoked by uid 99); 29 May 2009 17:00:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2009 17:00:35 +0000 X-ASF-Spam-Status: No, hits=-2.1 required=10.0 tests=DATE_IN_PAST_06_12,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.6.21] (HELO gmp-eb-inf-1.sun.com) (192.18.6.21) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2009 17:00:24 +0000 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10]) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n4TGxoUg005466 for ; Fri, 29 May 2009 17:00:03 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) id <0KKF0030008JIH00@fe-emea-10.sun.com> for derby-user@db.apache.org; Fri, 29 May 2009 17:59:50 +0100 (BST) Received: from [10.0.247.59] ([unknown] [192.18.41.196]) by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) with ESMTPSA id <0KKF004SK0JNU7G0@fe-emea-10.sun.com> for derby-user@db.apache.org; Fri, 29 May 2009 17:59:50 +0100 (BST) Date: Fri, 29 May 2009 09:59:44 +0200 From: Kristian Waagan Subject: Re: What happens during a database upgrade? In-reply-to: Sender: Kristian.Waagan@Sun.COM To: Derby Discussion Message-id: <4A1F95F0.2080302@Sun.COM> References: <23736685.post@talk.nabble.com> <4A1D4189.3010705@sun.com> <4A1D52E8.6030805@Sun.COM> <23761970.post@talk.nabble.com> User-Agent: Thunderbird 2.0.0.21 (X11/20090323) X-Virus-Checked: Checked by ClamAV on apache.org Knut Anders Hatlen wrote: > David Goulden writes: > >> For these tables we don't use ORDER BY, so hopefully the bug you mentioned >> won't affect us. Out of curiosity, is there any advantage to doing a hard >> upgrade? Except for the CLOB performance issue, we're quite happy with >> version 10.4. > > Hi David, > > Off the top of my head, I think the advantages you'll get from a hard > upgrade 10.4 -> 10.5 are faster length calculation for CLOBs and one new > system procedure (SYSCS_UTIL.SYSCS_UPDATE_STATISTICS). > Again, this is mostly correct. For existing CLOBs you won't get the faster length calculation, even if you do a hard upgrade. CLOBs inserted into a 10.5 database using the JDBC methods that take a length argument will benefit. If you use the "length less" JDBC overrides, than you're back to the 10.4 situation when it comes to the improved length calculation. Now, we don't really have a good way to upgrade the format of existing CLOBs yet. One possibility is to run this query: UPDATE myTable SET clobValue = clobValue || '' [WHERE length(clobValue) < someThreshold] This will upgrade the format by concatenating the existing CLOB with the empty string. However, the concatenation will materialize the CLOB, so if you have large CLOBs you need to have a lot of memory in the server (2 GB++). I have been looking into using a function that just returns the same CLOB passed in to it, but Derby doesn't support this yet. The advantage of that approach is that the CLOB hopefully won't be materialized. The implementation of this functionality has been started under DERBY-4066. Regards, -- Kristian