SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Jan 29, 2005, 06:15 #1
- Join Date
- Jan 2005
- Location
- San Francisco
- Posts
- 13
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Postgres: Do views update along with table data?
If I create a view based on a table or tables, does that view get automatically updated when the original data is updated? Or is a view more of a snapshot of the data at the instance of its creation?
I've poked around the postgres.org documentation, but was not able to find a definitive answer. I suspect there may be something simple I am missing.
Many thanks!
-
Jan 29, 2005, 19:36 #2
Views don't create any "snapshots" of data or get "updated" - they're just a facade to the underlying queries on the actual tables.
-
Jan 30, 2005, 20:15 #3
- Join Date
- Jan 2005
- Location
- North Haledon, NJ
- Posts
- 14
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A view is a mask that is applied to a table / set of tables / set of databases in order to make retrieval easier. In many cases retrieval times can be decreased with the use of a view because the db engine (query engine) can analyze and predict better what indexes to use.
Also I know that in Oracle (not sure about Postgres) You can join tables in totally seperate databases (even if they are on different servers) with the use of views.
But I digress
Bookmarks