db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-481) implement SQL generated columns
Date Wed, 22 Oct 2008 18:23:44 GMT

     [ 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-01-aa-catalog.diff

Attaching derby-481-01-aa-catalog.diff, the first small patch cut out of the prototype. Presented
for review. Tests pass cleanly for me. Tests for these catalog changes will appear in later

This patch provides the catalog support for generated columns. Catalog support turned out
to be simpler than the functional spec imagined. There is no need to add another column to
SYS.SYSCOLUMNS. Instead, we can re-use the existing COLUMNDEFAULT column to store the generation

Touches the following files:

M      java/engine/org/apache/derby/catalog/DefaultInfo.java
M      java/engine/org/apache/derby/catalog/types/DefaultInfoImpl.java

Special constructor for default descriptors which describe generated columns. A default descriptor
can tell you whether it represents a generated column. If it does, it can also tell you what
other columns the generation clause references.

M      java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java

Column descriptors can now tell you if they are bound to generation clauses.

M      java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java

The table descriptor can now return a list of all the columns which have generation clauses.

> 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:
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-481-00-aa-prototype.diff, derby-481-01-aa-catalog.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.

View raw message