db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Are generated columns stored in the DB or calculated on the fly?
Date Fri, 03 Sep 2010 21:49:40 GMT
Uriah Eisenstein <uriaheisenstein@gmail.com> 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

Mime
View raw message