I recently update phpmyadmin
and now I have this new option called Virtuality
when adding a new column.
[Virtuality] >VIRTUAL >STORED
What is this used for and when should it be used?
What Does Virtual Database Mean? A virtual database is a type of database management system that serves as a container to transparently view and query several other databases through a uniform API that culls from multiple sources as if they were a single entity.
In relational databases a virtual column is a table column whose value is automatically computed using other columns values, or another deterministic expression.
What is Virtual Column ? In general virtual columns appear to be normal table columns, but their values are derived rather than being stored on disk. Virtual columns are one of the top features in MySQL 5.7,they can store a value that is derived from one or several other fields in the same table in a new field.
Virtual columns are create by adding the keyword VIRTUAL to the column while adding an expression just before that. The good thing: you can add an index to the virtual column. If you need the actual values and are concerned about speed over storage use a PERSISTENT column.
column that is automatically computed (example: 'age' column):
CREATE TABLE users ( birth_year NUMBER(15,2) , death_year NUMBER(15,2) , age NUMBER(15,2) AS (death_year - birth_year) );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With