Re: View Vs. Table

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: radhika(at)88thstreet(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: View Vs. Table
Date: 2007-03-09 15:01:35
Message-ID: 20070309150135.GB23704@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Mar 06, 2007 at 09:32:19 -0500,
Radhika Sambamurti <sushi(at)88thstreet(dot)com> wrote:
>
> From the application's perspective the View is much better as data is
> being stored in one place, reducing errors and also storage.
> But from the db point of view, is there a bigger performace hit when I
> query a view Vs a table or is there no difference.

In postgres, views are essentially macros and there shouldn't be a big
performance hit for using them over issuing the equivalent query.

It sounds like what you might be asking is comparing views to storing
data in denormallized tables (esentially materialized views). You generally
don't want to go there unless you need to, to get acceptible performance.
(And note that denormallizing data doesn't always get you better performance.)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2007-03-09 15:03:32 Re: [Re: PRIMARY KEY]
Previous Message Gerardo Herzig 2007-03-09 15:01:30 index not being used. Why?