Re: Oracle 11g Virtual Columns?

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Mon, 19 Jan 2009 10:17:00 +0100
Message-ID: <49744511$0$186$e4fe514c_at_news.xs4all.nl>



zigzagdna_at_yahoo.com schreef:
> I have read various articles on virtual columns? I still do not
> understand their advantages other than they save some disk space, One
> can put logic of virtual columns in a trigger which will save
> information in a real column. Real column will need some additional
> disk space, but it will save some cpu time when one is doing slelects
> on “virtual” columns.

Filling columns with triggers is slightly different, because Oracle does not know
a) column values are derived from other column values in the same row (and maybe some functions)
b) column values can ONLY change if the other values change. Unless you write extra triggers to prohibit this, a column based on a trigger can be changed directly by an update statement, VC's can not.

You don't save CPU, because Oracle will 'cache' the values, which is made possible by the knowledge above.
Function Based Indexes are about the same as virtual columns, except you can not really SELECT by name on these values. I think I remember Oracle already 'secretly' stored FBI-values in a hidden column. Another advantage over FBI's is you can use the column name in the where clause, in stead of a function which had to be exactly the same one as used in the index.

Shakespeare Received on Mon Jan 19 2009 - 03:17:00 CST

Original text of this message