Instantly. Views really do not exist as separate copies of data; instead, they exist as instructions for rewriting queries.
That is, when you select columnA from blah
, MySQL internally overwrites this as select columnA from tableA
.
In systems that support materialized representations, the database is responsible for maintaining their relevance.
(Note that when a query is complex enough, MySQL will only internally materialize the view for the duration of the query. This is an implementation detail and is best considered a defect in the MySQL query optimizer. EXPLAIN
can be used to see when this happens, but you will probably notice terrible performance.)
source share