I understand MySQL views' usage, algorithms, advantage and disadvantage .. etc.
The only thing that I can't understand is How does MySQL DBMS process the views and update the view's data?
For example:-
We have three tables T1, T2 & T3 .. and We have a view called V1 which collects data from the three table, and a query called Q1 which select some data from V1
-
Assumption #1 (All is executed at once, the View first then the Query):
Q1 is executed, so V1 is updated first then the result returns.
-
Assumption #2 (The view is updated after any transaction is done on the related tables)
Insertion or Deletion transaction is executed on T2, V1 is updated, and anytime Q1 is executed the result returns from V1 (without updating V1, as in this case it's supposed to be updated all the times).
These are my assumptions, Can anybody clear this point for me, How does DBMS handle views?
Thank you so much