- http://www.codedata.com.tw/database/mysql-tutorial-11-views/
- http://enterpriserails.chak.org/full-text/chapter-11-view-backed-models
- http://enterpriserails.chak.org/full-text/chapter-12-materialized-views
- http://alexpotrykus.com/blog/2013/04/10/postgres-views-in-rails
- 何時用?
- 常用的query, subquery, 目的可以讓application layer 更清楚看這東西
- 特性:虛擬表格, 沒有真的存資料, view 的建立來源也可以從view 來 , 把它當作 named subquery, view 是just-in-time 是即時的。
- 資料變動 :
- 更新view table, original table will change too., 可以設定check option 來保證這資料符合view table query 條件
- 更新original table 勒 ?? you can only modify views by modifying the tables they depend on, 資料應該直接改original table, 可是拿的時候可以從view 拿。
- 效能? 沒差別, 就是個named subquery,