Comments - Generated (Virtual and Persistent/Stored) Columns

8 years ago Jan Steinman

Computed columns can only come from static, deterministic values.

You may find that "unfortunate," but I am having trouble understanding your desired semantics.

Do you intend the value of your expression to be frozen upon first evaluation, or rather to be updated (with NOW()) on every access?

The former can be done with a function or a simple UPDATE statement. The latter would seem to be quite costly.

One can only imagine the overhead involved in allowing computed columns to be made up of Any Damn Thing™ one wanted to have there. Should RAND() be allowed, for example?

 
7 years, 12 months ago guest guest

For PERSISTENT columns non-deterministic expressions of course are meaningless. For VIRTUAL columns it could make sense. Though, it would be the same as SELECT with explicitly written expression. So yes, that my post is stupid.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.