[GENERAL] Views - Under the Hood

2010-11-04 Thread Terry Lee Tucker
Greetings: Lately, I've begun using views quite often especially when queries for various reports, etc. become complicated. I am now wondering if there is a price to pay in terms of overhead for this. In truth, I don't really understand how a view works. I know that it takes on many of the

Re: [GENERAL] Views - Under the Hood

2010-11-04 Thread Scott Marlowe
On Thu, Nov 4, 2010 at 12:43 PM, Terry Lee Tucker te...@chosen-ones.org wrote: Greetings: Lately, I've begun using views quite often especially when queries for various reports, etc. become complicated. I am now wondering if there is a price to pay in terms of overhead for this. In truth, I

Re: [GENERAL] Views - Under the Hood

2010-11-04 Thread Terry Lee Tucker
On Thursday, November 04, 2010 15:03:49 Scott Marlowe wrote: On Thu, Nov 4, 2010 at 12:43 PM, Terry Lee Tucker te...@chosen-ones.org wrote: Greetings: Lately, I've begun using views quite often especially when queries for various reports, etc. become complicated. I am now wondering if

Re: [GENERAL] Views - Under the Hood

2010-11-04 Thread Chris Browne
te...@chosen-ones.org (Terry Lee Tucker) writes: Lately, I've begun using views quite often especially when queries for various reports, etc. become complicated. I am now wondering if there is a price to pay in terms of overhead for this. In truth, I don't really understand how a view

Re: [GENERAL] Views - Under the Hood

2010-11-04 Thread Raymond O'Donnell
On 04/11/2010 19:58, Chris Browne wrote: Under the hood, views represent a rewriting of the query. http://www.postgresql.org/docs/8.4/static/rules-views.html If you have two tables that are joined together, in a view, then when you query the view, you're really running a more complex query

Re: [GENERAL] Views - Under the Hood

2010-11-04 Thread Ivano Luberti
One of the benefits of writing views instead of using SQL in your code, is that any developer or developer tool can use the view. So the DB developer writes the view and maybe define indexes that can speed up the query and any developer of any software that uses the DB can refer to the View