Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 75264 invoked from network); 3 Sep 2010 21:50:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Sep 2010 21:50:25 -0000 Received: (qmail 26771 invoked by uid 500); 3 Sep 2010 21:50:25 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 26698 invoked by uid 500); 3 Sep 2010 21:50:24 -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 26691 invoked by uid 99); 3 Sep 2010 21:50:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Sep 2010 21:50:24 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [148.87.113.121] (HELO rcsinet10.oracle.com) (148.87.113.121) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Sep 2010 21:50:14 +0000 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o83Lnput012652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Sep 2010 21:49:53 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o83LLBCt000723 for ; Fri, 3 Sep 2010 21:49:51 GMT Received: from abhmt015.oracle.com by acsmt355.oracle.com with ESMTP id 575699941283550560; Fri, 03 Sep 2010 14:49:20 -0700 Received: from localhost (/84.215.53.73) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Sep 2010 14:49:19 -0700 From: Knut Anders Hatlen To: "Derby Discussion" Subject: Re: Are generated columns stored in the DB or calculated on the fly? References: Date: Fri, 03 Sep 2010 23:49:40 +0200 In-Reply-To: (Uriah Eisenstein's message of "Fri, 3 Sep 2010 17:32:36 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Uriah Eisenstein writes: > Hi Knut, > Thanks for your answer. May I suggest that this be added to the documentation > of generated columns? Yes, you may. :) Please file a JIRA report so that it's not forgotten. > I think support for virtual columns, as they're indeed called in some other > DBs, would really be nice though. For instance, Java Enums fit nicely as a > UDT, but indexing on them (or even simple comparisons) would require a > separate column with the ordinal integer value or the name string; in the > latter case, the space requirement is rather superfluous relatively to that of > the enum value itself. It seems to me this could be used as a partial solution > at least to expression-based indexes (Derby-455), by requiring indexes on > simple columns which may be virtual, or implementing the index by defining a > hidden virtual column, or something of the kind. Do you know if there's any > Derby improvement suggestion in that direction? (I havent'found any). Not that I'm aware of, but they sound like useful suggestions. For the Enum case, one alternative solution may be to improve the UDT support to allow comparisons and ordering if the Java type implements java.lang.Comparable. Since Enum implements Comparable, that should allow creating indexes directly on an Enum-based UDT column. -- Knut Anders