Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 11230 invoked from network); 30 Oct 2008 15:20:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2008 15:20:05 -0000 Received: (qmail 61687 invoked by uid 500); 30 Oct 2008 15:20:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 61663 invoked by uid 500); 30 Oct 2008 15:20:10 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 61652 invoked by uid 99); 30 Oct 2008 15:20:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 08:20:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 15:19:03 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 45085234C251 for ; Thu, 30 Oct 2008 08:19:44 -0700 (PDT) Message-ID: <1104451768.1225379984281.JavaMail.jira@brutus> Date: Thu, 30 Oct 2008 08:19:44 -0700 (PDT) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-481) implement SQL generated columns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-481: -------------------------------- Attachment: derby-481-06-aa-genreferences.diff Attaching derby-481-06-aa-genReferences.diff. This patch makes it illegal for generated columns to reference other generated columns, per the functional spec. Running regression tests now. Touches the following files: M java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java M java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java Adds some small helper methods to assist the machinery in TableElementList.bindAndValidateGenerationClauses. M java/engine/org/apache/derby/impl/sql/compile/TableElementList.java Adds logic to raise an exception if a generation clause mentions generated columns. M java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java M java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java Adds new argument to calls to TableElementList.bindAndValidateGenerationClauses. M java/engine/org/apache/derby/loc/messages.xml M java/shared/org/apache/derby/shared/common/reference/SQLState.java Adds new error message raised when generation clauses reference generated columns. M java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java Adds tests for this behavior. While I was in there, I added tests to verify some other functionality: generation clauses can't reference other tables or run subqueries. > implement SQL generated columns > ------------------------------- > > Key: DERBY-481 > URL: https://issues.apache.org/jira/browse/DERBY-481 > Project: Derby > Issue Type: New Feature > Components: SQL > Affects Versions: 10.0.2.1 > Reporter: Rick Hillegas > Assignee: Rick Hillegas > Attachments: derby-481-00-aa-prototype.diff, derby-481-01-aa-catalog.diff, derby-481-02-aa-utilities.diff, derby-481-03-aa-grammar.diff, derby-481-04-aa-insert.diff, derby-481-05-aa-update.diff, derby-481-06-aa-genreferences.diff, GeneratedColumns.html > > > Satheesh has pointed out that generated columns, a SQL 2003 feature, would satisfy the performance requirements of Expression Indexes (bug 455). Generated columns may not be as elegant as Expression Indexes, but they are easier to implement. We would allow the following new kind of column definition in CREATE TABLE and ALTER TABLE statements: > columnName GENERATED ALWAYS AS ( expression ) > If expression were an indexableExpression (as defined in bug 455), then we could create indexes on it. There is no work for the optimizer to do here. The Language merely has to compute the generated column at INSERT/UPDATE time. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.