STORED is a column modifier that follows a GENERATED ALWAYS AS (expression) clause. When applied, the database evaluates the expression whenever an INSERT or UPDATE touches the row and then physically saves the resulting value in the table. Future SELECT statements read the pre-computed value, eliminating re-calculation at query time and allowing the column to be indexed. The opposite behavior is a VIRTUAL (or non-stored) generated column, which is calculated on the fly and does not occupy storage. Using STORED can improve read performance and enable indexing on derived data, but it consumes extra disk space and may slow writes because the value must be computed and written for every row change. In most engines, a STORED column cannot reference non-deterministic functions, and attempting to directly insert or update the column is disallowed because the value is automatically maintained by the database.
MySQL 5.7 (2015) and SQL:2011 standard
It persists the calculated value to disk, enabling rapid reads and indexing.
No. The database manages the value; direct writes raise an error.
Yes. Every row contains a physical copy of the generated value.
MySQL 5.7+, MariaDB 5.2+, PostgreSQL 12+, SQLite 3.31+, Oracle 12c+, SQL Server 2022+, among others.