Re: Views - Under the Hood - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Views - Under the Hood
Date
Msg-id AANLkTik37kY8fZfsw-ztJggEYuOJewkWb8i-BjLxXjML@mail.gmail.com
Whole thread Raw
In response to Views - Under the Hood  (Terry Lee Tucker <terry@chosen-ones.org>)
Responses Re: Views - Under the Hood
List pgsql-general
On Thu, Nov 4, 2010 at 12:43 PM, Terry Lee Tucker <terry@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 don't really understand how a
> view works. I know that it takes on many of the attributes of a table, but is
> it a table? Is the data pulled together when one selects from the view or is
> it maintained as a table all along. Guidance to the ignorant appreciated...

In pgsql a view is actually a rule that fires off the original query
for you.  So it's a simple wrapper, and is the same, for the most
part, as simply typing in the original query again.  So, it's pretty
simple, and there's no real overhead to worry about.

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Linux
Next
From: Terry Lee Tucker
Date:
Subject: Re: Views - Under the Hood